blob: 4c5b62495b02c5a3f1dbc03bad450eff888868e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
from nonebot.adapters.cqhttp import Bot, MessageEvent
from ATRI.utils.limit import FreqLimiter
from .data_source import Rich
_rich_flmt = FreqLimiter(2)
bili_rich = Rich().on_message("小程序爪巴", block=False)
@bili_rich.handle()
async def _fk_bili(bot: Bot, 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)
except BaseException:
return
if not is_ok:
return
_rich_flmt.start_cd(user_id)
await bili_rich.finish(result)
|