From 09ddc36a2a0e739672c448dbe172877b805fc373 Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Thu, 22 Jun 2023 14:54:39 +0800 Subject: =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20=E4=BF=AE=E5=A4=8D=E5=BD=93?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=94=B1=E5=AF=B9=E5=BA=94=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF,=20?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=95=B0=E6=8D=AE=E6=96=87=E4=BB=B6=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/manage/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ATRI/plugins/manage/__init__.py b/ATRI/plugins/manage/__init__.py index 9d34c5a..698c29f 100644 --- a/ATRI/plugins/manage/__init__.py +++ b/ATRI/plugins/manage/__init__.py @@ -58,7 +58,9 @@ def handle_command( msg = success_msg.format(target) if type(result) == bool: msg += "启用" if result else "禁用" - await plugin.send(msg.format(target)) + if type(result) == str: + msg = result + await plugin.send(msg) except Exception as e: error_msg = str(e) await plugin.send(fail_msg.format(target, error_msg)) @@ -153,11 +155,11 @@ async def _(event: FriendRequestEvent): now_time = str(datetime.now().timestamp()) data = await BotManager().load_friend_req() - data[apply_code] = RequestInfo( + data[apply_code] = RequestInfo( # type: ignore user_id=user_id, comment=apply_comment, time=now_time, - ) + ).dict() await BotManager().store_friend_req(data) result = ( @@ -185,11 +187,11 @@ async def _(event: GroupRequestEvent): now_time = str(datetime.now().timestamp()) data = await BotManager().load_group_req() - data[apply_code] = RequestInfo( + data[apply_code] = RequestInfo( # type: ignore user_id=user_id, comment=apply_comment + f"(目标群{target_group})", time=now_time, - ) + ).dict() await BotManager().store_group_req(data) result = ( -- cgit v1.2.3