aboutsummaryrefslogtreecommitdiff
path: root/commands/Moderation
diff options
context:
space:
mode:
Diffstat (limited to 'commands/Moderation')
-rw-r--r--commands/Moderation/ban.js6
-rw-r--r--commands/Moderation/interrogate.js6
-rw-r--r--commands/Moderation/jail.js6
-rw-r--r--commands/Moderation/kick.js6
-rw-r--r--commands/Moderation/purge.js6
-rw-r--r--commands/Moderation/setLogs.js7
-rw-r--r--commands/Moderation/setSuggestions.js7
-rw-r--r--commands/Moderation/softban.js7
-rw-r--r--commands/Moderation/timeout.js5
-rw-r--r--commands/Moderation/warn.js6
10 files changed, 53 insertions, 9 deletions
diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js
index b9ffa4d..593d9e7 100644
--- a/commands/Moderation/ban.js
+++ b/commands/Moderation/ban.js
@@ -8,7 +8,6 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permission to ban members.');
if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permission to ban members.');
const member = msg.mentions.members.first();
@@ -42,6 +41,11 @@ exports.run = async (bot, msg, args) => {
}
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to ban members.';
+ return true;
+}
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/interrogate.js b/commands/Moderation/interrogate.js
index 821c93a..39c10a1 100644
--- a/commands/Moderation/interrogate.js
+++ b/commands/Moderation/interrogate.js
@@ -10,7 +10,6 @@
exports.run = async (bot, msg) => {
if (msg.guild.id != '417088992329334792') return msg.reply ('This is a PokeWorld exclusive command. Sorry!');
- if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permission to interrogate others. Rip-off detectives...');
if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot interrogate anyone.');
const member = msg.mentions.members.first();
@@ -36,6 +35,11 @@ exports.run = async (bot, msg) => {
}
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to interrogate others. Rip-off detectives...';
+ return true;
+}
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/jail.js b/commands/Moderation/jail.js
index 2dc50cf..87d18da 100644
--- a/commands/Moderation/jail.js
+++ b/commands/Moderation/jail.js
@@ -10,7 +10,6 @@
exports.run = async (bot, msg) => {
if (msg.guild.id != '417088992329334792') return msg.reply ('This is a PokeWorld exclusive command. Sorry!');
- if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permission to put members in jail.');
if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot put anyone in jail.');
const member = msg.mentions.members.first();
@@ -36,6 +35,11 @@ exports.run = async (bot, msg) => {
}
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to put members in jail.';
+ return true;
+}
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js
index 174e867..3ee88ea 100644
--- a/commands/Moderation/kick.js
+++ b/commands/Moderation/kick.js
@@ -8,7 +8,6 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- if (!msg.member.hasPermission('KICK_MEMBERS')) return msg.reply('You don\'t have permission to kick members.');
if (!msg.guild.member(bot.user).hasPermission('KICK_MEMBERS')) return msg.reply('I don\'t have permission to kick members.');
const member = msg.mentions.members.first();
@@ -20,6 +19,11 @@ exports.run = async (bot, msg, args) => {
msg.channel.send(`Alright, I kicked **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`);
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('KICK_MEMBERS')) return 'You don\'t have permission to kick members.';
+ return true;
+}
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/purge.js b/commands/Moderation/purge.js
index 6ce557c..f244960 100644
--- a/commands/Moderation/purge.js
+++ b/commands/Moderation/purge.js
@@ -8,7 +8,6 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.');
if (!msg.guild.member(bot.user).hasPermission('MANAGE_MESSAGES')) return msg.reply('I don\'t have permission to manage messages.');
const user = msg.mentions.users.first();
@@ -27,6 +26,11 @@ exports.run = async (bot, msg, args) => {
msg.channel.bulkDelete(msgs).catch(error => console.log(error.stack));
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to manage messages.';
+ return true;
+}
+
exports.conf = {
aliases: ['prune', 'rm'],
guildOnly: true,
diff --git a/commands/Moderation/setLogs.js b/commands/Moderation/setLogs.js
index 8ae50ea..e951c45 100644
--- a/commands/Moderation/setLogs.js
+++ b/commands/Moderation/setLogs.js
@@ -8,11 +8,16 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.');
bot.plugins.settings.setStr('logs', args[0], msg.guild.id);
msg.reply('Alright, I have set the log channel to ' + args[0]);
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to manage messages.';
+ return true;
+}
+
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/setSuggestions.js b/commands/Moderation/setSuggestions.js
index 2a9d1bd..ff5691e 100644
--- a/commands/Moderation/setSuggestions.js
+++ b/commands/Moderation/setSuggestions.js
@@ -8,11 +8,16 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.');
bot.plugins.settings.setStr('suggestions', args[0], msg.guild.id);
msg.reply('Alright, I have set the suggestions channel to ' + args[0]);
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to manage messages.';
+ return true;
+}
+
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/softban.js b/commands/Moderation/softban.js
index dd5b4a9..7c5119b 100644
--- a/commands/Moderation/softban.js
+++ b/commands/Moderation/softban.js
@@ -8,7 +8,6 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permission to ban members.');
if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permission to ban members.');
const member = msg.mentions.members.first();
@@ -48,6 +47,12 @@ exports.run = async (bot, msg, args) => {
}
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to ban members.';
+ return true;
+}
+
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/timeout.js b/commands/Moderation/timeout.js
index 294ebd5..d8722a8 100644
--- a/commands/Moderation/timeout.js
+++ b/commands/Moderation/timeout.js
@@ -36,6 +36,11 @@ exports.run = async (bot, msg) => {
}
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to put members in time-out..';
+ return true;
+}
+
exports.conf = {
aliases: [],
guildOnly: true,
diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js
index 1dd0410..b8548a3 100644
--- a/commands/Moderation/warn.js
+++ b/commands/Moderation/warn.js
@@ -8,7 +8,6 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to warn.');
args.shift();
const warnReason = args.join(' ');
const victim = msg.mentions.members.first();
@@ -43,6 +42,11 @@ exports.run = async (bot, msg, args) => {
);
};
+exports.checkPermission = (bot, member) => {
+ if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to warn.';
+ return true;
+}
+
exports.conf = {
aliases: [],
guildOnly: true,