Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
unsupported image send
Browse files Browse the repository at this point in the history
  • Loading branch information
guimc233 committed Jan 27, 2024
1 parent b5e4350 commit 9bf3252
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/kotlin/ltd/guimc/lgzbot/command/ACGCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import kotlinx.coroutines.launch
import ltd.guimc.lgzbot.PluginMain
import ltd.guimc.lgzbot.utils.CooldownUtils
import ltd.guimc.lgzbot.utils.ImageUtils
import ltd.guimc.lgzbot.utils.OverflowUtils
import net.mamoe.mirai.console.command.CommandSender
import net.mamoe.mirai.console.command.SimpleCommand

Expand All @@ -34,7 +35,11 @@ object ACGCommand: SimpleCommand (
}
cooldown.flag(user!!)
try {
sendMessage(ImageUtils.url2imageMessage("https://www.dmoe.cc/random.php", bot!!, subject!!))
if (!OverflowUtils.checkOverflowCore()) {
sendMessage(ImageUtils.url2imageMessage("https://www.dmoe.cc/random.php", bot!!, subject!!))
} else {
sendMessage("由于一些原因 无法发送图片")
}
} catch (ignore: Throwable) {
sendMessage("Oops, something went wrong.")
cooldown.addLeftTime(user!!, -10000L)
Expand Down

0 comments on commit 9bf3252

Please sign in to comment.