From 60a665362add2e6f30dc37f54367c6bbd6fd1f04 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Wed, 4 May 2022 14:59:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=8A=A0=E5=A5=BD=E5=8F=8B=E5=92=8C=E5=8A=A0=E7=BE=A4=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Paimon_Plugins/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Paimon_Plugins/__init__.py b/Paimon_Plugins/__init__.py index 054c27e..79eb90f 100644 --- a/Paimon_Plugins/__init__.py +++ b/Paimon_Plugins/__init__.py @@ -103,12 +103,14 @@ async def addFriend(bot: Bot, event: FriendRequestEvent): superuser_msg = f'{event.user_id}请求添加派蒙为好友, 验证信息为:{event.comment}' if config.paimon_add_friend == 1: superuser_msg += ',已自动同意' - await event.approve() + await sleep(random.randint(2, 4)) + await event.approve(bot) await sleep(random.randint(3, 6)) await bot.send_private_msg(user_id=event.user_id, message=f'旅行者你好呀,这里是小派蒙,发送/help查看帮助哦') elif config.paimon_add_friend == 2: superuser_msg += ',已自动拒绝' - await event.reject() + await sleep(random.randint(2, 4)) + await event.reject(bot) else: superuser_msg += ',请主人自行处理哦' await bot.send_private_msg(user_id=superuser, message=superuser_msg) @@ -121,12 +123,14 @@ async def addFriend(bot: Bot, event: GroupRequestEvent): superuser_msg = f'{event.user_id}邀请派蒙加入群{event.group_id}' if config.paimon_add_group == 1 or event.user_id == superuser: superuser_msg += ',已自动同意' - await event.approve() + await sleep(random.randint(2, 4)) + await event.approve(bot) await sleep(random.randint(3, 6)) await bot.send_group_msg(group_id=event.group_id, message=f'旅行者们大家好呀,这里是小派蒙,发送/help查看帮助哦') elif config.paimon_add_group == 2: superuser_msg += ',已自动拒绝' - await event.reject() + await sleep(random.randint(2, 4)) + await event.reject(bot) else: superuser_msg += ',请主人自行处理哦' await bot.send_private_msg(user_id=superuser, message=superuser_msg)