summaryrefslogtreecommitdiff
path: root/ATRI/plugins/rich
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2022-02-05 00:47:52 +0800
committerKyomotoi <[email protected]>2022-02-05 00:47:52 +0800
commitc38bab21b3c85e82250e3b82ebde31e2aca2db92 (patch)
treec0cee6ea72f8a8754a4c43927da6fe7954f54608 /ATRI/plugins/rich
parent46b56e61866592f13a289064d56e1c1464353fdf (diff)
downloadATRI-c38bab21b3c85e82250e3b82ebde31e2aca2db92.tar.gz
ATRI-c38bab21b3c85e82250e3b82ebde31e2aca2db92.tar.bz2
ATRI-c38bab21b3c85e82250e3b82ebde31e2aca2db92.zip
🚑️🔒️🔧 大型修复工作
针对传回消息不同适配、外置限制改为nb内置限制
Diffstat (limited to 'ATRI/plugins/rich')
-rw-r--r--ATRI/plugins/rich/__init__.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/ATRI/plugins/rich/__init__.py b/ATRI/plugins/rich/__init__.py
index 3b49750..2d8f8c6 100644
--- a/ATRI/plugins/rich/__init__.py
+++ b/ATRI/plugins/rich/__init__.py
@@ -1,20 +1,15 @@
from nonebot.adapters.onebot.v11 import MessageEvent
+from nonebot.adapters.onebot.v11.helpers import Cooldown
-from ATRI.utils.limit import FreqLimiter
from ATRI.log import logger as log
from .data_source import Rich
-_rich_flmt = FreqLimiter(3)
bili_rich = Rich().on_message("小程序检测", "小程序爪巴", block=False)
-@bili_rich.handle()
+@bili_rich.handle([Cooldown(3)])
async def _fk_bili(event: MessageEvent):
- user_id = event.get_user_id()
- if not _rich_flmt.check(user_id):
- return
-
msg = str(event.message)
try:
result, is_ok = await Rich().fk_bili(msg)
@@ -23,5 +18,4 @@ async def _fk_bili(event: MessageEvent):
log.debug(result, is_ok)
if not is_ok:
return
- _rich_flmt.start_cd(user_id)
await bili_rich.finish(result)