From 358253a4e36f5c5d9c1c4e51f75710dabfe42bf2 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Mon, 18 Nov 2024 19:32:48 +0500 Subject: [PATCH] ? --- helpers/tictactoe.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helpers/tictactoe.js b/helpers/tictactoe.js index c6b731b6..3c92cf08 100644 --- a/helpers/tictactoe.js +++ b/helpers/tictactoe.js @@ -16,7 +16,8 @@ const { ButtonBuilder, ActionRowBuilder, ButtonStyle, ComponentType } = require( * @returns {Promise} */ async function tictactoe(interaction, options = {}) { - return new Promise(resolve => { + // eslint-disable-next-line no-async-promise-executor + return new Promise(async resolve => { try { const { client } = interaction; let opponent; @@ -81,19 +82,20 @@ 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]); - const m = interaction.reply({ + const m = await 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, time: 30 * 1000, }); + collector.on("collect", async button => { if (button.user.id !== opponent.id) return button.reply({