mirror of https://github.com/Mai-with-u/MaiBot.git
Merge branch 'SengokuCola:debug' into debug
commit
7c4d3ec3fb
|
|
@ -39,9 +39,13 @@ def db_message_to_str(message_dict: Dict) -> str:
|
||||||
def is_mentioned_bot_in_message(message: MessageRecv) -> bool:
|
def is_mentioned_bot_in_message(message: MessageRecv) -> bool:
|
||||||
"""检查消息是否提到了机器人"""
|
"""检查消息是否提到了机器人"""
|
||||||
keywords = [global_config.BOT_NICKNAME]
|
keywords = [global_config.BOT_NICKNAME]
|
||||||
|
nicknames = global_config.BOT_ALIAS_NAMES
|
||||||
for keyword in keywords:
|
for keyword in keywords:
|
||||||
if keyword in message.processed_plain_text:
|
if keyword in message.processed_plain_text:
|
||||||
return True
|
return True
|
||||||
|
for nickname in nicknames:
|
||||||
|
if nickname in message.processed_plain_text:
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue