Update message_api.py

pull/1110/head
A0000Xz 2025-07-15 21:13:47 +08:00 committed by GitHub
parent 02f674494c
commit 1ec403c4f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -472,10 +472,12 @@ async def get_person_ids_from_messages(messages: List[Dict[str, Any]]) -> List[s
def filter_mai_messages(messages: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
"""
从消息列表中移除麦麦的消息
从消息列表中移除麦麦的消息并顺便过滤掉已经被命令截断的消息
Args:
messages: 消息列表每个元素是消息字典
Returns:
过滤后的消息列表
"""
return [msg for msg in messages if msg.get("user_id") != str(global_config.bot.qq_account)]
return [msg for msg in messages if msg.get("user_id") != str(global_config.bot.qq_account)
and msg.get("interested_rate") is not None
]