From ae7ea2d379ec7fb0edb8e333145bb141106a2fd2 Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Sat, 20 Feb 2021 08:19:41 +0800 Subject: =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=9F=8B=E4=B8=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新插件: - call-owner - code-runner - status - anime-search - tex(待修复) - 埋下bug: - service中limit作为机器人服务中的开关,目前写入文件亟待修复 --- ATRI/rule.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'ATRI/rule.py') diff --git a/ATRI/rule.py b/ATRI/rule.py index 586faf9..abc90f8 100644 --- a/ATRI/rule.py +++ b/ATRI/rule.py @@ -47,7 +47,7 @@ exciting_repo = [ "请稍等!您冲得太快了!" ] -def is_too_exciting(times: int) -> Rule: +def is_too_exciting(times: int, repo: bool) -> Rule: def del_list(user: str) -> None: global exciting_user exciting_user = del_list_aim(exciting_user, user) @@ -57,10 +57,11 @@ def is_too_exciting(times: int) -> Rule: user = event.get_user_id() if user in exciting_user: - await bot.send( - event, - choice(exciting_repo) - ) + if repo: + await bot.send( + event, + choice(exciting_repo) + ) return False else: if count_list(exciting_user, user) == times: @@ -76,10 +77,11 @@ def is_too_exciting(times: int) -> Rule: misfire_grace_time=1, ) - await bot.send( - event, - choice(exciting_repo) - ) + if repo: + await bot.send( + event, + choice(exciting_repo) + ) return False else: exciting_user.append(user) -- cgit v1.2.3