mirror of https://github.com/Mai-with-u/MaiBot.git
modified: src/plugins/chat/utils.py
parent
b42f8eed9c
commit
0da324bc8b
|
|
@ -47,7 +47,11 @@ def is_mentioned_bot_in_message(message: MessageRecv) -> bool:
|
|||
keywords = [global_config.BOT_NICKNAME]
|
||||
nicknames = global_config.BOT_ALIAS_NAMES
|
||||
message_content = re.sub(r'\[CQ:reply,[\s\S]*?\]','', message.raw_message)
|
||||
message_content = re.sub(r'\[CQ:cq,[\s\S]*?\]','', message_content)
|
||||
logger.exception(f"raw_message : {message.raw_message}")
|
||||
for keyword in keywords:
|
||||
if f"[回复 {keyword} 的消息: " in message.processed_plain_text:
|
||||
return True
|
||||
if keyword in message_content:
|
||||
return True
|
||||
for nickname in nicknames:
|
||||
|
|
@ -540,4 +544,4 @@ def is_western_char(char):
|
|||
def is_western_paragraph(paragraph):
|
||||
"""检测是否为西文字符段落"""
|
||||
return all(is_western_char(char) for char in paragraph if char.isalnum())
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue