diff options
author | Kyomotoi <[email protected]> | 2021-02-20 08:19:41 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2021-02-20 08:19:41 +0800 |
commit | ae7ea2d379ec7fb0edb8e333145bb141106a2fd2 (patch) | |
tree | 3243cb1dd668d36f92f17e958ff2a38e7b2c450c /ATRI/rule.py | |
parent | 3d16960b487f8911fb3817c2abcdb252ad848f58 (diff) | |
download | ATRI-ae7ea2d379ec7fb0edb8e333145bb141106a2fd2.tar.gz ATRI-ae7ea2d379ec7fb0edb8e333145bb141106a2fd2.tar.bz2 ATRI-ae7ea2d379ec7fb0edb8e333145bb141106a2fd2.zip |
✨ 更新插件,埋下bug
- 更新插件:
- call-owner
- code-runner
- status
- anime-search
- tex(待修复)
- 埋下bug:
- service中limit作为机器人服务中的开关,目前写入文件亟待修复
Diffstat (limited to 'ATRI/rule.py')
-rw-r--r-- | ATRI/rule.py | 20 |
1 files changed, 11 insertions, 9 deletions
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) |