From 10cc5cf27806e57db18e0bd7243028618a33c76f Mon Sep 17 00:00:00 2001 From: XuChenXu <91937041+ChenXu233@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:00:00 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=85=B3=E9=94=AE=E8=AF=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_dialectlist/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nonebot_plugin_dialectlist/utils.py b/nonebot_plugin_dialectlist/utils.py index ac4d6c4..6c89085 100644 --- a/nonebot_plugin_dialectlist/utils.py +++ b/nonebot_plugin_dialectlist/utils.py @@ -1,4 +1,5 @@ import os +import re import httpx import asyncio import unicodedata @@ -96,7 +97,8 @@ def msg_counter( for i in msg_list: # logger.debug(f"processing msg {i.plain_text}") if keyword: - if keyword not in i.plain_text: + match = re.search(keyword, i.plain_text) + if not match: continue try: lst[str(i.session_persist_id)] += 1