diff --git a/commands/search.js b/commands/search.js index 191e0fb..25a4cd6 100644 --- a/commands/search.js +++ b/commands/search.js @@ -40,6 +40,10 @@ module.exports = { return interaction.send({ content: `You are not allowed to use the bot in this channel.` }); } + if (GuildDB.onlyOfficersSearch && client.exists(GuildDB.officerRole) && !interaction.member.roles.includes(GuildDB.officerRole)) { + return interaction.send({ content: 'You don\'t have the permissions to use this command.' }); + } + let targetUserID = args[0].value.replace('<@!', '').replace('>', ''); let targetUserInventory = await client.dbo.collection("inventories").findOne({"inventory.userID":targetUserID}).then(inventory => inventory); let inventory;