This commit is contained in:
parent
30c7fd171f
commit
b8876188b1
4 changed files with 167 additions and 64 deletions
|
@ -21,10 +21,13 @@ module.exports = function(client, owners, message, globalPrefix){
|
|||
const command = client.commands.get(commandName);
|
||||
if(!command) return;
|
||||
if(command.needsWhitelist){
|
||||
let isWhitelisted = client.whitelist.get(message.guild.id)?.includes(command.name);
|
||||
if(!isWhitelisted){
|
||||
message.channel.send(`\`${command.name}\` is not whitelisted in this server. The bot admin needs to whitelist the command in this server for it to work`)
|
||||
return;
|
||||
let isGuildWhitelisted = client.whitelist.get(message.guild.id)?.includes(command.name);
|
||||
if(!isGuildWhitelisted){
|
||||
let isUserWhitelisted = client.whitelist.user.get(message.author.id)?.includes(command.name);
|
||||
if(!isUserWhitelisted){
|
||||
message.channel.send(`\`${command.name}\` is not whitelisted in this server. The bot admin needs to whitelist the command in this server for it to work`)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (command.admin && owners.indexOf(message.author.id.toString()) == -1) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue