From 19ed241e76a6db8c8a7a66f9f1e0f4e4d95d3603 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Mon, 18 Nov 2024 19:31:24 +0500 Subject: [PATCH] fix error in tictactoe --- helpers/tictactoe.js | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/helpers/tictactoe.js b/helpers/tictactoe.js index 4df1ae56..c6b731b6 100644 --- a/helpers/tictactoe.js +++ b/helpers/tictactoe.js @@ -81,23 +81,14 @@ async function tictactoe(interaction, options = {}) { const decline = new ButtonBuilder().setLabel(interaction.translate("common:DECLINE")).setStyle(ButtonStyle.Danger).setCustomId("declinettt"); const accep = new ActionRowBuilder().addComponents([accept, decline]); - let m; - if (interaction.commandId) - m = interaction.reply({ - content: interaction.translate("fun/tictactoe:INVITE_USER", { - opponent: opponent.id, - }), - embeds: [acceptEmbed], - components: [accep], - }); - else if (!interaction.commandId) - m = interaction.reply({ - content: interaction.translate("fun/tictactoe:INVITE_USER", { - opponent: opponent.id, - }), - embeds: [acceptEmbed], - components: [accep], - }); + const m = interaction.reply({ + content: interaction.translate("fun/tictactoe:INVITE_USER", { + opponent: opponent.id, + }), + embeds: [acceptEmbed], + components: [accep], + fetchReply: true, + }).then(m => m); const collector = m.createMessageComponentCollector({ componentType: ComponentType.Button,