From c6ca2198a389c05a0028ff06272a951f1a72cd11 Mon Sep 17 00:00:00 2001 From: ledouxm Date: Mon, 4 Mar 2024 14:26:34 +0100 Subject: [PATCH] add logs --- src/commands/buttons.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/buttons.ts b/src/commands/buttons.ts index abb2a4a..e730979 100644 --- a/src/commands/buttons.ts +++ b/src/commands/buttons.ts @@ -23,7 +23,8 @@ export const executeButtonInteraction = async (interaction: ButtonInteraction) = const { details, participantIndex: pIndex } = game[0]; const index = participantIndex ?? pIndex; - const participant = details.info.participants[index]; + console.log({ index, participantIndex, pIndex, id: interaction.customId }); + const participant = details.info.participants[Number(index)]; const file = await createMatchDetailsFile(details, participant); @@ -56,7 +57,7 @@ export const executeButtonInteraction = async (interaction: ButtonInteraction) = const { details, participantIndex: pIndex } = game[0]; const index = participantIndex ?? pIndex; - const participant = details.info.participants[index]; + const participant = details.info.participants[Number(index)]; const file = await createMatchDamageFile(details, participant);