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/plugins/rich | |
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/plugins/rich')
-rw-r--r-- | ATRI/plugins/rich/__init__.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ATRI/plugins/rich/__init__.py b/ATRI/plugins/rich/__init__.py index 6bea2ff..d20a234 100644 --- a/ATRI/plugins/rich/__init__.py +++ b/ATRI/plugins/rich/__init__.py @@ -5,19 +5,36 @@ from aiohttp.client import ClientSession from nonebot.adapters.cqhttp import Bot, MessageEvent from nonebot.plugin import on_message -from ATRI.rule import is_in_banlist, is_in_dormant from ATRI.utils.request import get_bytes +from ATRI.utils.list import count_list, del_list_aim +from ATRI.rule import ( + is_in_banlist, + is_in_dormant, +) + from .data_source import dec + +waiting_list = [] + + bilibili_rich = on_message( rule=is_in_banlist() & is_in_dormant() ) @bilibili_rich.handle() async def _bilibili_rich(bot: Bot, event: MessageEvent) -> None: + global waiting_list msg = str(event.raw_message) + user = event.user_id bv = False + if count_list(waiting_list, user) == 5: + waiting_list = del_list_aim(waiting_list, user) + return + + waiting_list.append(user) + if "qqdocurl" not in msg: if "av" in msg: av = re.findall(r"(av\d+)", msg)[0].replace('av', '') @@ -58,4 +75,3 @@ async def _bilibili_rich(bot: Bot, event: MessageEvent) -> None: "にまねげぴのTencent rich!" ) await bilibili_rich.finish(repo) -
\ No newline at end of file |