Add support for admin/owner only commands #3
This commit is contained in:
parent
5713c2c6af
commit
0b5156721d
1 changed files with 3 additions and 2 deletions
|
@ -5,7 +5,8 @@ const {
|
||||||
prefix,
|
prefix,
|
||||||
token,
|
token,
|
||||||
loginMessage,
|
loginMessage,
|
||||||
loginChannel
|
loginChannel,
|
||||||
|
owners
|
||||||
} = require('./config.json');
|
} = require('./config.json');
|
||||||
|
|
||||||
client.commands = new Discord.Collection();
|
client.commands = new Discord.Collection();
|
||||||
|
@ -38,7 +39,7 @@ client.on('message', async message => {
|
||||||
if (!message.guild) return;
|
if (!message.guild) return;
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
if (!message.content.startsWith(prefix)) return;
|
if (!message.content.startsWith(prefix)) return;
|
||||||
|
if (command.admin && owners.indexOf(message.author.id.toString()) == -1 ) return;
|
||||||
try {
|
try {
|
||||||
command.execute({message:message, args:args, client: client})
|
command.execute({message:message, args:args, client: client})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue