1
0

add role check for setup command

This commit is contained in:
2024-05-30 14:28:28 +02:00
parent 66bd8006e1
commit 8a2adc6a80

View File

@ -40,11 +40,11 @@ client.on('interactionCreate', async (interaction) => {
.setDescription('A Discord bot for role management.')
.addFields([
{ name: 'Featured commands:', value: commandsList },
{ name: 'Further questions?', value: 'Please contact the creator at the linked github repository.' }
{ name: 'Further questions?', value: 'Please contact the creator at the linked gitea repository.' }
])
.setFooter({
iconURL: client.user?.displayAvatarURL(),
text: `I was useful wasn't I?`
text: `One can never have enough socks.`
})
.setTimestamp()
.setColor('#000000');
@ -53,6 +53,11 @@ client.on('interactionCreate', async (interaction) => {
}
if (interaction.commandName === CommandsEnum.SETUP) {
const adminRole = interaction.guild?.roles.cache.find((role) => role.name === '💎 Moderator');
if (adminRole == null) return;
const userHasRole = (interaction.member?.roles as GuildMemberRoleManager).cache.has(adminRole.id);
if (!userHasRole) return;
const commandParameters = interaction.options.data;
const row = new ActionRowBuilder<ButtonBuilder>();