forked from mttu-developers/konabot
添加更加宽松的匹配规则
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import re
|
||||
from loguru import logger
|
||||
from nonebot import on_message
|
||||
from nonebot_plugin_alconna import UniMsg
|
||||
from nonebot_plugin_alconna import Reference, Reply, UniMsg
|
||||
|
||||
from nonebot.adapters import Event
|
||||
|
||||
@ -16,7 +16,8 @@ pattern = (
|
||||
|
||||
@matcher_fix.handle()
|
||||
async def _(msg: UniMsg, event: Event):
|
||||
if not re.search(pattern, msg.extract_plain_text()):
|
||||
to_search = msg.exclude(Reply, Reference).dump(json=True)
|
||||
if not re.search(pattern, to_search):
|
||||
return
|
||||
logger.info("检测到有 Bilibili 相关的消息,直接进行一个调用")
|
||||
_module = __import__("nonebot_plugin_analysis_bilibili")
|
||||
|
||||
Reference in New Issue
Block a user