diff options
author | Kyomotoi <[email protected]> | 2023-06-22 14:54:39 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2023-06-22 14:54:39 +0800 |
commit | 09ddc36a2a0e739672c448dbe172877b805fc373 (patch) | |
tree | a5b3b46c1a8e7f00dbafa5bfc7ded99e327adb4a /ATRI/plugins | |
parent | 54f293858cf145a76253f9573985740915a3b9dc (diff) | |
download | ATRI-09ddc36a2a0e739672c448dbe172877b805fc373.tar.gz ATRI-09ddc36a2a0e739672c448dbe172877b805fc373.tar.bz2 ATRI-09ddc36a2a0e739672c448dbe172877b805fc373.zip |
🚑️ 修复当信息由对应实现输出时的错误, 以及数据文件类型错误
Diffstat (limited to 'ATRI/plugins')
-rw-r--r-- | ATRI/plugins/manage/__init__.py | 12 |
1 files 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 = ( |