diff --git a/src/index.ts b/src/index.ts index 0e07a08..627983e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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();