bot admin

This commit is contained in:
SowinskiBraeden committed 2022-08-21 18:36:52 -07:00
1 parent a3e69dcca4
commit 5dd6a5059a
3 files changed
+118 -15

No files matched your search

+7
View File
@@ -68,6 +68,13 @@ module.exports = {
return interaction.send(`You are not allowed to use the bot in this channel.`);
}
const permissions = bitfieldCalculator.permissions(interaction.member.permissions);
let canUseCommand = false;
if (permissions.includes("MANAGE_GUILD")) canUseCommand = true;
if (client.exists(GuildDB.botAdmin) && interaction.member.roles.includes(GuildDB.botAdmin)) canUseCommand = true;
if (!canUseCommand) return interaction.send('You don\'t have the permissions to use this command.');
let targetUserID = args[0].options[0].value.replace('<@!', '').replace('>', '');
let banking = await client.dbo.collection("banks").findOne({"account.userID": targetUserID}).then(banking => banking);