diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 178a9c93..ebafb0a3 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -36,11 +36,11 @@ module.exports = class BanCommand extends Command { async run(msg, args) { const modlogs = parseTopic(msg.guild.channels, 'modlog', this.client.user).first(); const { member, reason } = args; + if (member.id === msg.author.id) return msg.say('I don\'t think you want to ban yourself...'); if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); if (member.highestRole.calculatedPosition > msg.member.highestRole.calculatedPosition - 1) { return msg.say('Your roles are too low to ban this member.'); } - if (member.id === msg.author.id) return msg.say('I don\'t think you want to ban yourself...'); await msg.say(`Are you sure you want to ban ${member.user.tag} (${member.id})?`); const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { max: 1, diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 510ccbf0..070b301a 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -36,11 +36,11 @@ module.exports = class KickCommand extends Command { async run(msg, args) { const modlogs = parseTopic(msg.guild.channels, 'modlog', this.client.user).first(); const { member, reason } = args; + if (member.id === msg.author.id) return msg.say('I don\'t think you want to kick yourself...'); if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?'); if (member.highestRole.calculatedPosition > msg.member.highestRole.calculatedPosition - 1) { return msg.say('Your roles are too low to kick this member.'); } - if (member.id === msg.author.id) return msg.say('I don\'t think you want to kick yourself...'); await msg.say(`Are you sure you want to kick ${member.user.tag} (${member.id})?`); const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { max: 1, diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 962bc145..f63038af 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -36,11 +36,11 @@ module.exports = class SoftbanCommand extends Command { async run(msg, args) { const modlogs = parseTopic(msg.guild.channels, 'modlog', this.client.user).first(); const { member, reason } = args; + if (member.id === msg.author.id) return msg.say('I don\'t think you want to softban yourself...'); if (!member.bannable) return msg.say('This member is not softbannable. Perhaps they have a higher role than me?'); if (member.highestRole.calculatedPosition > msg.member.highestRole.calculatedPosition - 1) { return msg.say('Your roles are too low to softban this member.'); } - if (member.id === msg.author.id) return msg.say('I don\'t think you want to softban yourself...'); await msg.say(`Are you sure you want to softban ${member.user.tag} (${member.id})?`); const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { max: 1, diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 233e42a0..1be75b0c 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -35,11 +35,11 @@ module.exports = class WarnCommand extends Command { async run(msg, args) { const modlogs = parseTopic(msg.guild.channels, 'modlog', this.client.user).first(); const { member, reason } = args; + if (member.id === msg.author.id) return msg.say('I don\'t think you want to warn yourself...'); if (!member.kickable) return msg.say('This member is not warnable. Perhaps they have a higher role than me?'); if (member.highestRole.calculatedPosition > msg.member.highestRole.calculatedPosition - 1) { return msg.say('Your roles are too low to warn this member.'); } - if (member.id === msg.author.id) return msg.say('I don\'t think you want to warn yourself...'); await msg.say(`Are you sure you want to warn ${member.user.tag} (${member.id})?`); const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { max: 1,