chore: improve rdm command

This commit is contained in:
2024-09-28 16:31:55 +08:00
parent 9aab28334e
commit 32c822c3a1
19 files changed
+82 -82

No files matched your search

@@ -7,6 +7,7 @@
package cn.rtast.fancybot.commands.misc
import cn.rtast.fancybot.configManager
import cn.rtast.fancybot.entity.bullshit.BullShit
import cn.rtast.fancybot.util.Resources
import cn.rtast.fancybot.util.str.fromJson
@@ -61,7 +62,7 @@ class BullShitGenerateCommand : BaseCommand() {
}
val finalText = output.toString().replace("x", topic)
val node = NodeMessageChain.Builder()
.addMessageChain(MessageChain.Builder().addText(finalText).build(), message.sender.userId)
.addMessageChain(MessageChain.Builder().addText(finalText).build(), configManager.selfId)
.build()
message.reply(node)
message.sender.groupPoke()
@@ -44,11 +44,7 @@ class SendMailCommand : BaseCommand() {
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
if (args.isEmpty()) {
val msg = MessageChain.Builder()
.addAt(message.sender.userId)
.addText("发送`/mail <收件人地址>`即可发送测试邮件~")
.build()
listener.sendGroupMessage(message.groupId, msg)
message.reply("发送`/mail <收件人地址>`即可发送测试邮件~")
return
}
if (message.sender.userId !in configManager.admins) {
@@ -61,10 +57,6 @@ class SendMailCommand : BaseCommand() {
}
val target = args.first()
this.sendMail(target)
val msg = MessageChain.Builder()
.addAt(message.sender.userId)
.addText("正在发送邮件, 请查收~(可能会出现在垃圾桶中~)")
.build()
listener.sendGroupMessage(message.groupId, msg)
message.reply("正在发送邮件, 请查收~(可能会出现在垃圾桶中~)")
}
}
@@ -8,6 +8,7 @@
package cn.rtast.fancybot.commands.misc
import cn.rtast.fancybot.annotations.CommandDescription
import cn.rtast.fancybot.configManager
import cn.rtast.fancybot.entity.Setu
import cn.rtast.fancybot.util.Http
import cn.rtast.fancybot.util.str.encodeToBase64
@@ -30,7 +31,7 @@ class TenSetuCommand : BaseCommand() {
try {
val imageBase64 = URI(it).toURL().readBytes().encodeToBase64()
val tempMsg = MessageChain.Builder().addImage(imageBase64, true).build()
nodeMsg.addMessageChain(tempMsg, message.sender.userId)
nodeMsg.addMessageChain(tempMsg, configManager.selfId)
} catch (_: Exception) {
}
}
@@ -39,7 +40,7 @@ class TenSetuCommand : BaseCommand() {
.addNewLine()
.addText("因为过滤了R18的图片~")
.build()
nodeMsg.addMessageChain(footerMsg, message.sender.userId)
nodeMsg.addMessageChain(footerMsg, configManager.selfId)
listener.sendGroupForwardMsg(message.groupId, nodeMsg.build())
}
}