From 32fb7bc005d60b51a2e33432de01b24d55bf7b59 Mon Sep 17 00:00:00 2001 From: Supositware Date: Tue, 4 Apr 2023 23:20:30 +0000 Subject: [PATCH] Really did a sloppy job on that one, remember kids, copy pasting is bad! --- commands/admin/tag.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/commands/admin/tag.js b/commands/admin/tag.js index bf58cd0..40e45d0 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -96,13 +96,13 @@ export default { await interaction.editReply({ content: 'This tag already exist, do you want to update it, remove it or do nothing?', components: [row], ephemeral: true }); - client.on('interactionCreate', async (interactionMenu) => { + client.once('interactionCreate', async (interactionMenu) => { if (interaction.user !== interactionMenu.user) return; if (!interactionMenu.isButton) return; - interactionMenu.update({ components: [] }); + await interactionMenu.update({ components: [] }); if (interactionMenu.customId === `edit${interaction.user.id}`) { const body = { trigger: args.trigger, response: args.response, ownerID: interaction.user.id, serverID: interaction.guild.id }; - await db.joinChannel.update(body, { where: { guildID: interaction.guild.id } }); + await db.Tag.update(body, { where: { serverID: interaction.guild.id } }); return interaction.editReply({ content: `The tag ${args.trigger} has been set to ${args.response}`, ephemeral: true }); } else if (interactionMenu.customId === `remove${interaction.user.id}`) { @@ -117,16 +117,5 @@ export default { else { return interaction.editReply(`You are not the owner of this tag, if you think it is problematic ask an admin to remove it by doing ${this.client.commandHandler.prefix[0]}tag ${args.trigger} --remove`); } - - const join = await db.joinChannel.findOne({ where: { guildID: interaction.guild.id } }); - - if (!join && !args.message) { - return interaction.editReply({ content: 'You need a message for me to say anything!', ephemeral: true }); - } - else if (!join) { - const body = { guildID: interaction.guild.id, channelID: interaction.channel.id, message: args.message }; - await db.joinChannel.create(body); - return interaction.editReply({ content: `The join message have been set with ${args.message}`, ephemeral: true }); - } }, };