Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Events/Interactions/ButtonUse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,22 @@ 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))
interaction.reply({
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}**`)]
})
Expand Down