Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 18, 2024
1 parent ef184b1 commit b4b045e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/extend/message_queue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""消息队列,控制消息发送频率"""

import asyncio
from queue import Queue
from time import sleep
Expand Down
4 changes: 3 additions & 1 deletion app/plugin/basic/__06_permission/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ async def grant(target: Union[Friend, Member], sender: Union[Friend, Group], cmd
return message("master level 不可更改!若想进行修改请直接修改配置文件!").target(sender).send()
elif result == 3:
if not Permission.manual(target, 4):
return message("权限不足,你必须达到等级4(master level)才可修改超级管理员权限!").target(sender).send() # noqa: E501
return (
message("权限不足,你必须达到等级4(master level)才可修改超级管理员权限!").target(sender).send()
) # noqa: E501
ADMIN_USER.remove(target)
if level == 2:
GROUP_ADMIN_USER.append(target)
Expand Down
4 changes: 3 additions & 1 deletion app/plugin/basic/__07_group_qa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ async def answer(user: Member, group: Group, msg: MessageChain):
return msg.display

qa = await get_config("group_qa", sender) or []
message("请在180秒内输入关键词, 若关键词一致则修改相关回答内容, 发送 #取消# 取消添加/修改").target(sender).quote(source).send()
message("请在180秒内输入关键词, 若关键词一致则修改相关回答内容, 发送 #取消# 取消添加/修改").target(sender).quote(
source
).send()
keyword = await DefaultFunctionWaiter(answer, [GroupMessage]).wait(180, "TimeoutError")
if keyword == "TimeoutError":
return message("等待超时!").target(sender).send()
Expand Down
4 changes: 3 additions & 1 deletion app/plugin/basic/__11_game/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ async def rank(target: Union[Friend, Member], sender: Union[Friend, Group]):
@command.parse("auto")
async def auto(target: Union[Friend, Member], sender: Union[Friend, Group], cmd: Arpamar):
await BotGame(target.id).auto_signin(cmd.query("status"))
return message("开启成功,将于每日 8 点为您自动签到!" if cmd.query("status") else "关闭成功!").target(sender).send() # noqa: E501
return (
message("开启成功,将于每日 8 点为您自动签到!" if cmd.query("status") else "关闭成功!").target(sender).send()
) # noqa: E501


@sche.schedule(timers.crontabify("0 7 * * * 0"))
Expand Down
1 change: 1 addition & 0 deletions app/util/control.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Xenon 管理 https://github.com/McZoo/Xenon/blob/master/lib/control.py
"""

from functools import wraps
from typing import Union

Expand Down
1 change: 1 addition & 0 deletions app/util/graia/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""对Ariadne 相关功能进行封装"""

from graia.ariadne import Ariadne as Ariadne
from graia.ariadne.event.message import ActiveFriendMessage as ActiveFriendMessage
from graia.ariadne.event.message import ActiveGroupMessage as ActiveGroupMessage
Expand Down

0 comments on commit b4b045e

Please sign in to comment.