Corrected ratelimit issue

Corrected ratelimit issue where takeCommand and untakeCommand wouldn't
work due to discord ratelimiting channels name changing
This commit is contained in:
ninjdai1 2022-11-13 18:24:04 +01:00
parent 651fbaa6f9
commit e3f46685c4

View File

@ -142,7 +142,7 @@ module.exports = {
.setCustomId(`ticket_close-${interaction.customId.replace("ticket_","").split("-")[1]}`), .setCustomId(`ticket_close-${interaction.customId.replace("ticket_","").split("-")[1]}`),
]); ]);
const artist = await client.database.artists.findOne({ where: { name: interaction.user.id } }); 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: [ await interaction.followUp({ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() }) .setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() })
@ -174,11 +174,11 @@ module.exports = {
.setCustomId(`ticket_close-${interaction.customId.replace("ticket_","").split("-")[2]}`), .setCustomId(`ticket_close-${interaction.customId.replace("ticket_","").split("-")[2]}`),
]); ]);
const artistUntake = await client.database.artists.findOne({ where: { name: interaction.user.id } }); 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: [ await interaction.followUp({ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() }) .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') .setColor('#ce0808')
] }); ] });
await interaction.editReply({ components: [ticketRowUntaken] }); await interaction.editReply({ components: [ticketRowUntaken] });