From b4a3e636e5d9962ab2cc5590fca1d9c33e51a858 Mon Sep 17 00:00:00 2001 From: Guimc Date: Sat, 24 Feb 2024 16:16:10 +0800 Subject: [PATCH] fix: MessageFilter --- .../ltd/guimc/lgzbot/listener/message/MessageFilter.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt b/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt index a895ed8..bed7500 100644 --- a/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt +++ b/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt @@ -32,6 +32,7 @@ import net.mamoe.mirai.contact.Group import net.mamoe.mirai.contact.Member import net.mamoe.mirai.event.events.GroupMessageEvent import net.mamoe.mirai.message.data.ForwardMessage +import net.mamoe.mirai.message.data.ForwardMessageBuilder import net.mamoe.mirai.message.data.MessageChain import net.mamoe.mirai.message.data.MessageSource.Key.recall import net.mamoe.mirai.message.data.content @@ -145,7 +146,9 @@ object MessageFilter { val botOwner = e.bot.getFriend(Config.BotOwner) requireNotNull(botOwner) botOwner.sendMessage("发现一条模型认为违规的消息, 但正则匹配失败, 请检查.") - botOwner.sendMessage(e.message) + val outputMessage = ForwardMessageBuilder(e.group) + outputMessage.add(e) + botOwner.sendMessage(outputMessage.build()) } } }