From 89cfe42b9c3c1e6fc51782e3f7f527e115e3e712 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 17 Feb 2023 08:35:06 -0500 Subject: [PATCH] Set Permissions --- modules/functions.js | 1 - slash-commands/reset.js | 3 ++- slash-commands/rolemenu.js | 3 ++- slash-commands/setup.js | 3 ++- slash-commands/setupinfo.js | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/functions.js b/modules/functions.js index 0e7b0e2..72d0a4f 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -627,7 +627,6 @@ const functions = { collector.on('collect', message => { if (message.embeds.length == 0) return; guildInfo = client.guildInfos.get(guild.id); - console.log(message.embeds); if (message.embeds[0].data.description.includes(strings.notifications.water)) { this.sendWaterReminder(guildInfo, guildInfo.waterMessage, guildInfo.reminderChannelId, guild); } else if (message.embeds[0].data.description.includes(strings.notifications.fruit)) { diff --git a/slash-commands/reset.js b/slash-commands/reset.js index 7cd7985..3409480 100644 --- a/slash-commands/reset.js +++ b/slash-commands/reset.js @@ -4,7 +4,8 @@ const fn = require('../modules/functions.js'); module.exports = { data: new SlashCommandBuilder() .setName('reset') - .setDescription('Reset all message assignments in your server'), + .setDescription('Reset all message assignments in your server') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), execute(interaction) { interaction.deferReply({ ephemeral: true }).then(() => { fn.reset(interaction.guildId).then(res => { diff --git a/slash-commands/rolemenu.js b/slash-commands/rolemenu.js index 5f1a479..7315a84 100644 --- a/slash-commands/rolemenu.js +++ b/slash-commands/rolemenu.js @@ -13,7 +13,8 @@ module.exports = { .addRoleOption(o => o.setName('fruitrole') .setDescription('The role for fruit alert pings') - .setRequired(false)), + .setRequired(false)) + .setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles), async execute(interaction) { await interaction.deferReply().catch(err => console.error(err)); if (interaction.client.guildInfos.has(interaction.guildId)) { diff --git a/slash-commands/setup.js b/slash-commands/setup.js index cbd1350..63cd681 100644 --- a/slash-commands/setup.js +++ b/slash-commands/setup.js @@ -14,7 +14,8 @@ module.exports = { .addChannelOption(o => o.setName('leaderboardchannel') .setDescription('If your leaderboard isn\'t in the same channel, where is it?') - .setRequired(false)), + .setRequired(false)) + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction) { await interaction.deferReply({ ephemeral: true }); /**/ diff --git a/slash-commands/setupinfo.js b/slash-commands/setupinfo.js index 9f24358..c191183 100644 --- a/slash-commands/setupinfo.js +++ b/slash-commands/setupinfo.js @@ -4,7 +4,8 @@ const fn = require('../modules/functions.js'); module.exports = { data: new SlashCommandBuilder() .setName('setupinfo') - .setDescription('View information about how the bot is set up in your server'), + .setDescription('View information about how the bot is set up in your server') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction) { await interaction.deferReply({ ephemeral: true }).catch(err => console.error(err)); try {