use onlyOfficersSearch config

This commit is contained in:
SowinskiBraeden committed 2022-10-09 15:57:38 -07:00
1 parent c4483d3ef5
commit a3f9ae818e
1 file changed
+4
+4
View File
@@ -40,6 +40,10 @@ module.exports = {
return interaction.send({ content: `You are not allowed to use the bot in this channel.` }); 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 targetUserID = args[0].value.replace('<@!', '').replace('>', '');
let targetUserInventory = await client.dbo.collection("inventories").findOne({"inventory.userID":targetUserID}).then(inventory => inventory); let targetUserInventory = await client.dbo.collection("inventories").findOne({"inventory.userID":targetUserID}).then(inventory => inventory);
let inventory; let inventory;