mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-12-27 20:35:38 -05:00
Prepare for button roles.
This commit is contained in:
parent
1c05375a39
commit
3bdc70a3a1
@ -14,6 +14,7 @@
|
||||
"registerCommands": true,
|
||||
"commands": true,
|
||||
"logs": true,
|
||||
"buttonRoles": true,
|
||||
"automod": true,
|
||||
"mpstats": true,
|
||||
"autores": true
|
||||
|
@ -16,6 +16,17 @@ export default {
|
||||
return interaction.reply('An error occurred while executing that command.');
|
||||
}
|
||||
}
|
||||
} else if (interaction.isButton()){
|
||||
if (interaction.customId.startsWith('reaction-') && client.config.botSwitches.buttonRoles){
|
||||
const RoleID = interaction.customId.replace('reaction-','');
|
||||
if (interaction.member.roles.cache.has(RoleID)){
|
||||
interaction.member.roles.remove(RoleID);
|
||||
interaction.reply({content: `You have been removed from <@&${RoleID}>`, ephemeral: true})
|
||||
} else {
|
||||
interaction.member.roles.add(RoleID);
|
||||
interaction.reply({content: `You have been added to <@&${RoleID}>`, ephemeral: true})
|
||||
}
|
||||
} else console.log(client.logTime(), `Button pressed at ${interaction.message.url}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
1
src/typings/interfaces.d.ts
vendored
1
src/typings/interfaces.d.ts
vendored
@ -151,6 +151,7 @@ interface botSwitches {
|
||||
registerCommands: boolean,
|
||||
commands: boolean,
|
||||
logs: boolean,
|
||||
buttonRoles: boolean,
|
||||
automod: boolean,
|
||||
mpstats: boolean,
|
||||
autores: boolean
|
||||
|
Loading…
Reference in New Issue
Block a user