From 8a31dce4d49c97e713a880bcf2e0224d807e6fe3 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Thu, 26 Sep 2024 22:11:28 +0800 Subject: [PATCH] chore: use reply --- .../cn/rtast/fancybot/commands/misc/CompilerCommand.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/misc/CompilerCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/misc/CompilerCommand.kt index fd34c6c..f9334ce 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/misc/CompilerCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/misc/CompilerCommand.kt @@ -28,11 +28,7 @@ class CompilerCommand : BaseCommand() { override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List) { if (args.isEmpty()) { - val msg = MessageChain.Builder() - .addAt(message.sender.userId) - .addText("使用`/exec` <语言> <代码> 即可执行~") - .build() - listener.sendGroupMessage(message.groupId, msg) + message.reply("使用`/exec` <语言> <代码> 即可执行~") return } val language = args.first() @@ -53,7 +49,7 @@ class CompilerCommand : BaseCommand() { } } val msg = MessageChain.Builder() - .addAt(message.sender.userId) + .addReply(message.messageId) .addText("执行结果如下:") .addNewLine() .addText(response.replace("", "").replace("", ""))