From 556a37174e1e62ccae5382ead4c57f4df94f3388 Mon Sep 17 00:00:00 2001 From: LunaUrsa <1836049+LunaUrsa@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:54:18 -0600 Subject: [PATCH] bug logging --- src/discord/commands/global/d.ai.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/discord/commands/global/d.ai.ts b/src/discord/commands/global/d.ai.ts index fe50e0ef4..f0c579275 100644 --- a/src/discord/commands/global/d.ai.ts +++ b/src/discord/commands/global/d.ai.ts @@ -2268,7 +2268,15 @@ export async function aiReaction( const thumbsUpEmojis = ['👍', '👍🏻', '👍🏼', '👍🏽', '👍🏾', '👍🏿', 'ts_thumbup']; const thumbsDownEmojis = ['👎', '👎🏻', '👎🏼', '👎🏽', '👎🏾', '👎🏿', 'ts_thumbdown']; if (messageReaction.message.reference === null) return; - const originalMessage = await messageReaction.message.fetchReference(); + let originalMessage = {} as Message; + try { + originalMessage = await messageReaction.message.fetchReference(); + } catch (error) { + log.error(F, `Error fetching reference: ${error}`); + log.error(F, `Reaction: ${JSON.stringify(messageReaction, null, 2)}`); + log.error(F, `Message: ${JSON.stringify(messageReaction.message, null, 2)}`); + return; + } const aiLinkData = await getLinkedChannel(originalMessage.channel); // log.debug(F, `aiLinkData: ${JSON.stringify(aiLinkData, null, 2)}`);