1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00

Add reason to audit logs for button role system.

This commit is contained in:
AnxietyisReal 2023-05-03 10:12:59 +10:00
parent 0d32686ffd
commit 11f7792bef

View File

@ -20,10 +20,10 @@ export default {
if (interaction.customId.startsWith('reaction-') && client.config.botSwitches.buttonRoles){ if (interaction.customId.startsWith('reaction-') && client.config.botSwitches.buttonRoles){
const RoleID = interaction.customId.replace('reaction-',''); const RoleID = interaction.customId.replace('reaction-','');
if (interaction.member.roles.cache.has(RoleID)){ if (interaction.member.roles.cache.has(RoleID)){
interaction.member.roles.remove(RoleID); interaction.member.roles.remove(RoleID, 'Button Role');
interaction.reply({content: `You have been removed from <@&${RoleID}>`, ephemeral: true}) interaction.reply({content: `You have been removed from <@&${RoleID}>`, ephemeral: true})
} else { } else {
interaction.member.roles.add(RoleID); interaction.member.roles.add(RoleID, 'Button Role');
interaction.reply({content: `You have been added to <@&${RoleID}>`, ephemeral: true}) interaction.reply({content: `You have been added to <@&${RoleID}>`, ephemeral: true})
} }
} else console.log(client.logTime(), `Button pressed at ${interaction.message.url}`); } else console.log(client.logTime(), `Button pressed at ${interaction.message.url}`);