mirror of
https://github.com/ChenXu233/nonebot_plugin_dialectlist.git
synced 2024-11-27 17:45:07 +08:00
✨ 关键词支持正则
This commit is contained in:
parent
ed167a56b5
commit
10cc5cf278
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import httpx
|
import httpx
|
||||||
import asyncio
|
import asyncio
|
||||||
import unicodedata
|
import unicodedata
|
||||||
@ -96,7 +97,8 @@ def msg_counter(
|
|||||||
for i in msg_list:
|
for i in msg_list:
|
||||||
# logger.debug(f"processing msg {i.plain_text}")
|
# logger.debug(f"processing msg {i.plain_text}")
|
||||||
if keyword:
|
if keyword:
|
||||||
if keyword not in i.plain_text:
|
match = re.search(keyword, i.plain_text)
|
||||||
|
if not match:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
lst[str(i.session_persist_id)] += 1
|
lst[str(i.session_persist_id)] += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user