diff --git a/app/extend/message_queue.py b/app/extend/message_queue.py index b32b2ad..e37b096 100644 --- a/app/extend/message_queue.py +++ b/app/extend/message_queue.py @@ -1,4 +1,5 @@ """消息队列,控制消息发送频率""" + import asyncio from queue import Queue from time import sleep diff --git a/app/plugin/basic/__06_permission/main.py b/app/plugin/basic/__06_permission/main.py index a1026ad..71b0bbe 100644 --- a/app/plugin/basic/__06_permission/main.py +++ b/app/plugin/basic/__06_permission/main.py @@ -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) diff --git a/app/plugin/basic/__07_group_qa/main.py b/app/plugin/basic/__07_group_qa/main.py index 7fe5162..634dd33 100644 --- a/app/plugin/basic/__07_group_qa/main.py +++ b/app/plugin/basic/__07_group_qa/main.py @@ -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() diff --git a/app/plugin/basic/__11_game/main.py b/app/plugin/basic/__11_game/main.py index 6a1137c..d1c947e 100644 --- a/app/plugin/basic/__11_game/main.py +++ b/app/plugin/basic/__11_game/main.py @@ -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")) diff --git a/app/util/control.py b/app/util/control.py index 17d8768..fbf9be8 100644 --- a/app/util/control.py +++ b/app/util/control.py @@ -1,6 +1,7 @@ """ Xenon 管理 https://github.com/McZoo/Xenon/blob/master/lib/control.py """ + from functools import wraps from typing import Union diff --git a/app/util/graia/__init__.py b/app/util/graia/__init__.py index fadbcda..320083f 100644 --- a/app/util/graia/__init__.py +++ b/app/util/graia/__init__.py @@ -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