I recently made my ticket bot, but I need to add a cooldown to the “close ticket” button to prevent someone from flooding the button and sending multiple messages, I haven’t found any possible way to do that. how would i add a cooldown on a specific button?
My button code:
const row = new client.discord.MessageActionRow()
.addComponents(
new client.discord.MessageButton()
.setCustomId('confirm-close')
.setLabel('Fechar o Ticket')
.setStyle('DANGER'),
new client.discord.MessageButton()
.setCustomId('no')
.setLabel('Cancelar Fechamento')
.setStyle('SECONDARY'),
);
const verif = await interaction.reply({
content: 'Tem certeza de que deseja fechar o ticket?',
components: [row]
});
For user identification, I’m using interaction.user.id