From 509147d6512f1f533babf7b567263b6b7bbaaf9d Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Tue, 22 Jul 2025 17:02:54 -0400 Subject: [PATCH] logging fix --- src/events/interactionCreate.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index d87bcf2..b5dda18 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -86,11 +86,15 @@ export const interactionCreateHandler = async (interaction: Interaction) => { if (ownerId === userInteractingId) { const botMsg: DiscordenoMessage = await structures.createDiscordenoMessage(interaction.message); if (botMsg && botMsg.messageReference) { - const rollMsg: DiscordenoMessage = await getMessage( - BigInt(botMsg.messageReference.channelId ?? '0'), - BigInt(botMsg.messageReference.messageId ?? '0'), + const rollMsg = await getMessage(BigInt(botMsg.messageReference.channelId ?? '0'), BigInt(botMsg.messageReference.messageId ?? '0')).catch((e) => + utils.commonLoggers.messageGetError( + 'interactionCreate.ts:92', + botMsg.messageReference?.channelId ?? '0', + botMsg.messageReference?.messageId ?? '0', + e, + ) ); - if (!rollMsg.isBot) { + if (rollMsg && !rollMsg.isBot) { ackInteraction(interaction); messageCreateHandler(rollMsg); return;