From e81a2896748b1009e4ac9c1238ea45affc7573fd Mon Sep 17 00:00:00 2001 From: Yuto Nishida Date: Mon, 7 Sep 2026 16:13:09 -0700 Subject: [PATCH] =?UTF-8?q?[yutobot-discord]=20Reply=20when=20the=20wiimen?= =?UTF-8?q?u=20(=E2=92=B6)=20render=20fails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The loadImage(...).then(...) chain had no catch, so a failed PNG load or send left the Ⓐ command silent and produced an unhandled promise rejection. Add a catch at the end of the chain that logs and replies "sry, Ⓐ button broke :(". Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01QaRcUCq39o8hvEwcuH6foZ --- yutobot-discord/src/modules/wiimenu/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yutobot-discord/src/modules/wiimenu/index.js b/yutobot-discord/src/modules/wiimenu/index.js index 8dddc56..0d946a2 100644 --- a/yutobot-discord/src/modules/wiimenu/index.js +++ b/yutobot-discord/src/modules/wiimenu/index.js @@ -30,6 +30,10 @@ const { registerFont, createCanvas, loadImage } = require('canvas'); ctx.fillText(time, 980, 860); return message.channel.send(new Discord.MessageAttachment(canvas.toBuffer("image/png"))); + }).catch((err) => { + console.error("wiimenu failed."); + console.error(err); + message.channel.send("sry, Ⓐ button broke :("); }); }; -- 2.51.2