From 2c3bf24f5996753df4a2d4456949fc0b636f6366 Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 30 Oct 2019 22:28:49 -0400 Subject: Added an optional checkPermission function and upgraded quick.db. --- commands/Owners Only/eval.js | 6 +++++- commands/Owners Only/leaveguild.js | 6 +++++- commands/Owners Only/modifycredits.js | 7 +++++-- commands/Owners Only/poweroff.js | 18 +++++++++--------- commands/Owners Only/say.js | 14 +++++++------- commands/Owners Only/testingcredits.js | 7 +++++-- 6 files changed, 36 insertions(+), 22 deletions(-) (limited to 'commands/Owners Only') diff --git a/commands/Owners Only/eval.js b/commands/Owners Only/eval.js index 09aac08..5153b63 100644 --- a/commands/Owners Only/eval.js +++ b/commands/Owners Only/eval.js @@ -8,7 +8,6 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(msg.author.id)) return msg.reply('Nope! You need the person who created this bot to use this command.'); const { RichEmbed } = require('discord.js'); const code = args.join(' '); @@ -63,6 +62,11 @@ exports.run = async (bot, msg, args) => { } }; +exports.checkPermission = (bot, member) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + return true; +} + exports.conf = { aliases: ['exec'], guildOnly: false, diff --git a/commands/Owners Only/leaveguild.js b/commands/Owners Only/leaveguild.js index 2af5244..f214b8b 100644 --- a/commands/Owners Only/leaveguild.js +++ b/commands/Owners Only/leaveguild.js @@ -7,11 +7,15 @@ * * *************************************/ module.exports.run = async (bot, msg) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409', msg.guild.owner.user.id].includes(msg.author.id)) return msg.reply('Nope! You need the person who created this bot or the owner of this guild to use this command.'); msg.channel.send('Alright, I\'m leaving the server now. Bye everyone!') msg.guild.leave(); }; + exports.checkPermission = (bot, member) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + return true; + } + exports.conf = { aliases: [], guildOnly: true, diff --git a/commands/Owners Only/modifycredits.js b/commands/Owners Only/modifycredits.js index 050d74d..6ec7506 100644 --- a/commands/Owners Only/modifycredits.js +++ b/commands/Owners Only/modifycredits.js @@ -8,8 +8,6 @@ * *************************************/ exports.run = async (bot, msg) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409', '269516487566426112'].includes(msg.author.id)) return msg.reply('Nope! You need the person who created this bot to use this command.'); - let user; if (!msg.mentions.users.first()) { user = msg.author; @@ -24,6 +22,11 @@ exports.run = async (bot, msg) => { msg.channel.send(`Reset ${user.tag}'s credits.`); }; +exports.checkPermission = (bot, member) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + return true; +} + exports.conf = { aliases: [], guildOnly: true, diff --git a/commands/Owners Only/poweroff.js b/commands/Owners Only/poweroff.js index e369b0a..3d2cbdd 100644 --- a/commands/Owners Only/poweroff.js +++ b/commands/Owners Only/poweroff.js @@ -8,17 +8,17 @@ * *************************************/ exports.run = async (bot, msg) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(msg.author.id)) { - msg.reply('Nope! You need the person who created this bot to use this command.'); - } - else { - await msg.reply(':warning: Pokebot is now powering off!'); - await bot.user.setStatus('invisible') - console.log('Pokebot is now powering off...'); - process.exit(0); - } + await msg.reply(':warning: Pokebot is now powering off!'); + await bot.user.setStatus('invisible') + console.log('Pokebot is now powering off...'); + process.exit(0); }; +exports.checkPermission = (bot, member) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + return true; +} + exports.conf = { aliases: ['reboot', 'restart'], guildOnly: true, diff --git a/commands/Owners Only/say.js b/commands/Owners Only/say.js index 3085d53..ace2874 100644 --- a/commands/Owners Only/say.js +++ b/commands/Owners Only/say.js @@ -8,15 +8,15 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409', '269516487566426112'].includes(msg.author.id)) { - msg.reply('Nope! You need the person who created this bot to use this command.'); - } - else { - msg.channel.send(args.join(' ')); - msg.delete(); - } + msg.channel.send(args.join(' ')); + msg.delete(); }; +exports.checkPermission = (bot, member) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + return true; +} + exports.conf = { aliases: [], guildOnly: true, diff --git a/commands/Owners Only/testingcredits.js b/commands/Owners Only/testingcredits.js index bee93b2..85cc859 100644 --- a/commands/Owners Only/testingcredits.js +++ b/commands/Owners Only/testingcredits.js @@ -8,8 +8,6 @@ * *************************************/ exports.run = async (bot, msg) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(msg.author.id)) return msg.reply('Nope! You need the person who created this bot to use this command.'); - let user; if (!msg.mentions.members.first()) { user = msg.author; @@ -22,6 +20,11 @@ exports.run = async (bot, msg) => { msg.channel.send('Added 1000 credits'); }; +exports.checkPermission = (bot, member) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + return true; +} + exports.conf = { aliases: [], guildOnly: true, -- cgit v1.2.3