Merge pull request #724 from RockChinQ/fix/at-resp

Fix: 回复并at机器人时会多一个at组件
This commit is contained in:
Junyan Qin 2024-03-13 16:31:54 +08:00 committed by GitHub
commit 6a4ea5446a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,10 @@ class AtBotRule(rule_model.GroupRespondRule):
if message_chain.has(mirai.At(query.adapter.bot_account_id)) and rule_dict['at']:
message_chain.remove(mirai.At(query.adapter.bot_account_id))
if message_chain.has(mirai.At(query.adapter.bot_account_id)): # 回复消息时会at两次检查并删除重复的
message_chain.remove(mirai.At(query.adapter.bot_account_id))
return entities.RuleJudgeResult(
matching=True,
replacement=message_chain,