From d036c2bdbaf3de12a9800427057533923d3d5ab0 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Sun, 13 Oct 2024 10:55:08 +0800 Subject: [PATCH] chore: add image expired exception catch --- .../cn/rtast/fancybot/commands/reply/ImageBedCommand.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/reply/ImageBedCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/reply/ImageBedCommand.kt index 58b14b3..a3f19b5 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/reply/ImageBedCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/reply/ImageBedCommand.kt @@ -17,6 +17,7 @@ import cn.rtast.rob.entity.GetMessage import cn.rtast.rob.entity.GroupMessage import cn.rtast.rob.util.ob.MessageChain import cn.rtast.rob.util.ob.asNode +import okio.IOException object ImageBedCommand { suspend fun execute(getMsg: GetMessage.Data, message: GroupMessage) { @@ -50,7 +51,10 @@ object ImageBedCommand { } message.reply(messages.asNode(configManager.selfId)) } + } catch (_: IOException) { + message.reply("上传失败: 图片已过期") } catch (e: Exception) { + e.printStackTrace() message.reply("上传失败: ${e.message}") } }