1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-29 12:30:58 -04:00

Add reason to audit logs for button role system.

This commit is contained in:
toast-ts 2023-05-03 10:12:59 +10:00
parent 3bdc70a3a1
commit 62a375b52f

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}`);