diff options
-rw-r--r-- | ATRI/plugins/anime_search.py | 1 | ||||
-rw-r--r-- | ATRI/plugins/manage/__init__.py | 6 | ||||
-rw-r--r-- | ATRI/plugins/manage/modules/debug.py | 1 | ||||
-rw-r--r-- | ATRI/plugins/manage/modules/dormant.py | 4 | ||||
-rw-r--r-- | ATRI/plugins/manage/modules/request.py | 13 | ||||
-rw-r--r-- | ATRI/utils/ub_paste.py | 2 |
6 files changed, 12 insertions, 15 deletions
diff --git a/ATRI/plugins/anime_search.py b/ATRI/plugins/anime_search.py index 0dba9d7..a62ed5e 100644 --- a/ATRI/plugins/anime_search.py +++ b/ATRI/plugins/anime_search.py @@ -2,7 +2,6 @@ import re import json from aiohttp import FormData -from nonebot.adapters.cqhttp.message import MessageSegment from nonebot.adapters.cqhttp import Bot, MessageEvent from nonebot.adapters.cqhttp.message import Message from nonebot.typing import T_State diff --git a/ATRI/plugins/manage/__init__.py b/ATRI/plugins/manage/__init__.py index c60171e..d9f1ffe 100644 --- a/ATRI/plugins/manage/__init__.py +++ b/ATRI/plugins/manage/__init__.py @@ -1,8 +1,8 @@ -import nonebot as nb +import nonebot from pathlib import Path _sub_plugins = set() -_sub_plugins |= nb.load_plugins( - str((Path(__file__).parent / 'modules').resolve())) +_sub_plugins |= nonebot.load_plugins( + str((Path(__file__).parent / 'modules').resolve())) diff --git a/ATRI/plugins/manage/modules/debug.py b/ATRI/plugins/manage/modules/debug.py index 66a84cf..53b75b7 100644 --- a/ATRI/plugins/manage/modules/debug.py +++ b/ATRI/plugins/manage/modules/debug.py @@ -3,7 +3,6 @@ from aiohttp import FormData from nonebot.typing import T_State from nonebot.permission import SUPERUSER from nonebot.adapters.cqhttp import Bot, MessageEvent -from nonebot.adapters.cqhttp.message import MessageSegment from ATRI.service import Service as sv from ATRI.log import LOGGER_DIR, NOW_TIME diff --git a/ATRI/plugins/manage/modules/dormant.py b/ATRI/plugins/manage/modules/dormant.py index 5274eaa..68d14f9 100644 --- a/ATRI/plugins/manage/modules/dormant.py +++ b/ATRI/plugins/manage/modules/dormant.py @@ -22,7 +22,7 @@ async def _dormant_enabled(bot: Bot, event: MessageEvent) -> None: sv.Dormant.control_dormant(True) msg = "已进入休眠状态...期间咱不会回应任何人的消息哦..." await dormant_enabled.finish(msg) - + __doc__ = """ 苏醒,开始处理信息 @@ -41,4 +41,4 @@ dormant_disabled = sv.on_command( async def _dormant_disabled(bot: Bot, event: MessageEvent) -> None: sv.Dormant.control_dormant(False) msg = "唔...早上好...——哇哈哈" - await dormant_disabled.finish(msg)
\ No newline at end of file + await dormant_disabled.finish(msg) diff --git a/ATRI/plugins/manage/modules/request.py b/ATRI/plugins/manage/modules/request.py index c90ed66..843a94e 100644 --- a/ATRI/plugins/manage/modules/request.py +++ b/ATRI/plugins/manage/modules/request.py @@ -2,7 +2,6 @@ import re import json from pathlib import Path -from nonebot.typing import T_State from nonebot.permission import SUPERUSER from nonebot.adapters.cqhttp import Bot, MessageEvent @@ -27,7 +26,7 @@ req_list = sv.on_command( ) @req_list.handle() -async def _req_list(bot: Bot, event: MessageEvent, state: T_State) -> None: +async def _req_list(bot: Bot, event: MessageEvent) -> None: path_f = ESSENTIAL_DIR / 'request_friend.json' path_g = ESSENTIAL_DIR / 'request_group.json' data_f, data_g = dict() @@ -64,7 +63,7 @@ req_deal = sv.on_regex( ) @req_deal.handle() -async def _req_deal(bot: Bot, event: MessageEvent, state: T_State) -> None: +async def _req_deal(bot: Bot, event: MessageEvent) -> None: msg = str(event.message).split(' ') arg = re.findall(r'[同意|拒绝][好友|群]申请', msg[0]) app = arg[0] @@ -86,7 +85,7 @@ async def _req_deal(bot: Bot, event: MessageEvent, state: T_State) -> None: try: await bot.set_friend_add_request(flag=reqid, approve=True) - await req_deal.finish(f"完成~!已同意申请") + await req_deal.finish('完成~!已同意申请') except FormatError: await req_deal.finish('请检查输入的值是否正确——!') elif _type == "群": @@ -94,7 +93,7 @@ async def _req_deal(bot: Bot, event: MessageEvent, state: T_State) -> None: await bot.set_group_add_request(flag=reqid, sub_type=data_g[reqid]['sub_type'], approve=True) - await req_deal.finish(f"完成~!已同意申请") + await req_deal.finish('完成~!已同意申请') except FormatError: await req_deal.finish('请检查输入的值是否正确——!') else: @@ -104,7 +103,7 @@ async def _req_deal(bot: Bot, event: MessageEvent, state: T_State) -> None: try: await bot.set_friend_add_request(flag=reqid, approve=False) - await req_deal.finish(f"完成~!已拒绝申请") + await req_deal.finish('完成~!已拒绝申请') except FormatError: await req_deal.finish('请检查输入的值是否正确——!') elif _type == "群": @@ -112,7 +111,7 @@ async def _req_deal(bot: Bot, event: MessageEvent, state: T_State) -> None: await bot.set_group_add_request(flag=reqid, sub_type=data_g[reqid]['sub_type'], approve=False) - await req_deal.finish(f"完成~!已拒绝申请") + await req_deal.finish('完成~!已拒绝申请') except FormatError: await req_deal.finish('请检查输入的值是否正确——!') else: diff --git a/ATRI/utils/ub_paste.py b/ATRI/utils/ub_paste.py index a0c0b07..c029afe 100644 --- a/ATRI/utils/ub_paste.py +++ b/ATRI/utils/ub_paste.py @@ -1,4 +1,4 @@ -from aiohttp import ClientSession, FormData +from aiohttp import ClientSession URL = "https://paste.ubuntu.com/" |