Botched Fix at permission check

master
masterhc 1 year ago
parent 0924069bf0
commit fae1929cf9

@ -197,12 +197,13 @@ class _Client extends Client
{
let needsAdmin = this.commands.get(commandName).needsAdmin;
let isAdmin =false;
try {
try
{
isAdmin = this.guilds.cache.get(message.guild.id).members.cache.get(message.author.id).permissions.has('ADMINISTRATOR');
} catch (error) {
console.log(error)
} catch (error)
{
console.log('Lib: Command: Permission Verification: Failed')
}
// console.log('IsAdmin: ', this.guilds.cache.get(message.guild.id).members.cache.get(message.author.id).permissions.any('ADMINISTRATOR', true))
let command = this.commands.get(commandName).command
if((needsAdmin && isAdmin) || !needsAdmin) return new command(this).run(message, args);
}

Loading…
Cancel
Save