From 7e17f7564eb2d465e2d5830f27b7ef1d64b4e455 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sat, 10 Sep 2022 09:35:32 +0200 Subject: [PATCH] Fix interactionCreate listener --- commands/admin/autoresponse.js | 3 ++- commands/admin/bye.js | 3 ++- commands/admin/quotation.js | 3 ++- commands/admin/welcome.js | 3 ++- commands/owner/ublacklist.js | 3 ++- commands/utility/optout.js | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/commands/admin/autoresponse.js b/commands/admin/autoresponse.js index 34255a6..b16e3b6 100644 --- a/commands/admin/autoresponse.js +++ b/commands/admin/autoresponse.js @@ -32,7 +32,8 @@ export default { await interaction.reply({ content: 'Autoresponse is already enabled, do you wish to disable it?', components: [row], ephemeral: true }); - client.once('interactionCreate', async (interactionMenu) => { + client.on('interactionCreate', async (interactionMenu) => { + if (interaction.user !== interactionMenu.user) return; if (!interactionMenu.isButton) return; interactionMenu.update({ components: [] }); if (interactionMenu.customId === 'yes') { diff --git a/commands/admin/bye.js b/commands/admin/bye.js index 741d846..787ee44 100644 --- a/commands/admin/bye.js +++ b/commands/admin/bye.js @@ -44,7 +44,8 @@ export default { await interaction.reply({ content: 'The server already has a message set, do you want to edit it or remove it?', components: [row], ephemeral: true }); - client.once('interactionCreate', async (interactionMenu) => { + client.on('interactionCreate', async (interactionMenu) => { + if (interaction.user !== interactionMenu.user) return; if (!interactionMenu.isButton) return; interactionMenu.update({ components: [] }); if (interactionMenu.customId === 'edit') { diff --git a/commands/admin/quotation.js b/commands/admin/quotation.js index 7839567..673b0e5 100644 --- a/commands/admin/quotation.js +++ b/commands/admin/quotation.js @@ -32,7 +32,8 @@ export default { await interaction.reply({ content: 'Quotation is already enabled, do you wish to disable it?', components: [row], ephemeral: true }); - client.once('interactionCreate', async (interactionMenu) => { + client.on('interactionCreate', async (interactionMenu) => { + if (interaction.user !== interactionMenu.user) return; if (!interactionMenu.isButton) return; interactionMenu.update({ components: [] }); if (interactionMenu.customId === 'yes') { diff --git a/commands/admin/welcome.js b/commands/admin/welcome.js index 5d70fd0..a49dd5f 100644 --- a/commands/admin/welcome.js +++ b/commands/admin/welcome.js @@ -45,7 +45,8 @@ export default { await interaction.reply({ content: 'The server already has a message set, do you want to edit it or remove it?', components: [row], ephemeral: true }); - client.once('interactionCreate', async (interactionMenu) => { + client.on('interactionCreate', async (interactionMenu) => { + if (interaction.user !== interactionMenu.user) return; if (!interactionMenu.isButton) return; interactionMenu.update({ components: [] }); if (interactionMenu.customId === 'edit') { diff --git a/commands/owner/ublacklist.js b/commands/owner/ublacklist.js index 75661cd..1c0d564 100644 --- a/commands/owner/ublacklist.js +++ b/commands/owner/ublacklist.js @@ -54,7 +54,8 @@ export default { await interaction.editReply({ content: 'This user is already blacklisted, do you want to unblacklist him?', ephemeral: true, components: [row] }); - interaction.client.once('interactionCreate', async (interactionMenu) => { + interaction.client.on('interactionCreate', async (interactionMenu) => { + if (interaction.user !== interactionMenu.user) return; if (!interactionMenu.isButton) return; interactionMenu.update({ components: [] }); if (interactionMenu.customId === 'yes') { diff --git a/commands/utility/optout.js b/commands/utility/optout.js index 277fe71..e1548d2 100644 --- a/commands/utility/optout.js +++ b/commands/utility/optout.js @@ -31,7 +31,8 @@ export default { await interaction.reply({ content: 'You are already opt out, do you wish to opt in?', components: [row] }); - client.once('interactionCreate', async (interactionMenu) => { + client.on('interactionCreate', async (interactionMenu) => { + if (interaction.user !== interactionMenu.user) return; if (!interactionMenu.isButton) return; interactionMenu.update({ components: [] }); if (interactionMenu.customId === 'yes') {