diff --git a/Events/Interactions/ButtonUse.ts b/Events/Interactions/ButtonUse.ts index e9f9415..7832cf2 100644 --- a/Events/Interactions/ButtonUse.ts +++ b/Events/Interactions/ButtonUse.ts @@ -44,6 +44,13 @@ export async function execute(interaction, client: DiscordClient) { ephemeral: true }) } + + if(interaction.channel.topic?.includes('Approved')) { + return interaction.reply({ + content: `This application has already been approved!`, + ephemeral: true + }) + } const usr = interaction.guild.members.cache.find(m => m.id === interaction.channel.topic); usr.roles.add(interaction.guild.roles.cache.find(r => r.id === client.config.guild.roles.rw)) @@ -51,6 +58,8 @@ export async function execute(interaction, client: DiscordClient) { content: `**🥳 Congrats <@${usr.user.id}>! You have been approved for the \`rw\` role!**` }) + interaction.channel.setTopic(`${interaction.channel.topic} - Approved`, `The user has been approved`) + if(chan instanceof TextChannel) chan?.send({ embeds: [new EmbedBuilder().setDescription(`**${interaction.member.user.tag} approved: ${interaction.channel.name}**`)] })