Skip to content

Commit

Permalink
fix: 回复并at机器人时会多一个at组件
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Mar 13, 2024
1 parent 63303bb commit 74e84c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/pipeline/resprule/rules/atbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ async def match(

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,
Expand Down

0 comments on commit 74e84c7

Please sign in to comment.