Skip to content

Commit

Permalink
fix: ACGCommand send img
Browse files Browse the repository at this point in the history
  • Loading branch information
guimc233 committed Jan 27, 2024
1 parent d93c23b commit 8bf6a56
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/ltd/guimc/lgzbot/command/ACGCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ltd.guimc.lgzbot.utils.OverflowUtils
import net.mamoe.mirai.console.command.CommandSender
import net.mamoe.mirai.console.command.SimpleCommand
import net.mamoe.mirai.console.command.getGroupOrNull
import top.mrxiaom.overflow.contact.RemoteBot
import top.mrxiaom.overflow.OverflowAPI

object ACGCommand: SimpleCommand (
owner = PluginMain,
Expand All @@ -41,9 +41,7 @@ object ACGCommand: SimpleCommand (
if (!OverflowUtils.checkOverflowCore()) {
sendMessage(ImageUtils.url2imageMessage("https://www.dmoe.cc/random.php", bot!!, subject!!))
} else {
if (group != null) {
(bot as RemoteBot).executeAction("send_group_msg", "{\"group_id\": ${group.id}, \"message\": \"[CQ:image,url=https://www.dmoe.cc/random.php]\n\"}")
}
sendMessage(OverflowAPI.get().imageFromFile("https://www.dmoe.cc/random.php"))
}
} catch (ignore: Throwable) {
sendMessage("Oops, something went wrong.")
Expand Down

0 comments on commit 8bf6a56

Please sign in to comment.