From e3f46685c4791ae3c48c7af63773241806698fed Mon Sep 17 00:00:00 2001 From: ninjdai1 Date: Sun, 13 Nov 2022 18:24:04 +0100 Subject: [PATCH] Corrected ratelimit issue Corrected ratelimit issue where takeCommand and untakeCommand wouldn't work due to discord ratelimiting channels name changing --- interactions/buttons/src/ticket/ticket.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interactions/buttons/src/ticket/ticket.js b/interactions/buttons/src/ticket/ticket.js index 1f077c6..12d4368 100644 --- a/interactions/buttons/src/ticket/ticket.js +++ b/interactions/buttons/src/ticket/ticket.js @@ -142,7 +142,7 @@ module.exports = { .setCustomId(`ticket_close-${interaction.customId.replace("ticket_","").split("-")[1]}`), ]); const artist = await client.database.artists.findOne({ where: { name: interaction.user.id } }); - await interaction.channel.setName((artist ? artist.emoji :"🟢")+interaction.channel.name); + interaction.channel.setName((artist ? artist.emoji :"🟢")+interaction.channel.name); await interaction.followUp({ embeds: [ new EmbedBuilder() .setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() }) @@ -174,11 +174,11 @@ module.exports = { .setCustomId(`ticket_close-${interaction.customId.replace("ticket_","").split("-")[2]}`), ]); const artistUntake = await client.database.artists.findOne({ where: { name: interaction.user.id } }); - await interaction.channel.setName(interaction.channel.name.replace(artistUntake ? artistUntake.emoji :"🟢","")); + interaction.channel.setName(interaction.channel.name.replace(artistUntake ? artistUntake.emoji :"🟢","")); await interaction.followUp({ embeds: [ new EmbedBuilder() .setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() }) - .setDescription(`<@${interaction.user.id}> ne prend plus en charge le ticket ! ${untakeMessage}`) + .setDescription(`<@${interaction.customId.replace("ticket_","").split("-")[1]}> ne prend plus en charge le ticket ! ${untakeMessage}`) .setColor('#ce0808') ] }); await interaction.editReply({ components: [ticketRowUntaken] });