From 57ee7fa82bb739f2ea44fff5231f8593130579b6 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 2 May 2017 15:41:19 +0000 Subject: [PATCH] hasPermission --- commands/moderation/ban.js | 2 +- commands/moderation/kick.js | 2 +- commands/moderation/lockdown.js | 2 +- commands/moderation/prune.js | 2 +- commands/moderation/softban.js | 2 +- commands/moderation/unban.js | 2 +- commands/moderation/warn.js | 2 +- commands/util/clearsetting.js | 2 +- commands/util/memberchannel.js | 2 +- commands/util/modchannel.js | 2 +- commands/util/staffrole.js | 2 +- package.json | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 9ce6f6d6..29703564 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -31,7 +31,7 @@ module.exports = class BanCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); } async run(msg, args) { diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 38a83970..dd7619ee 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -28,7 +28,7 @@ module.exports = class KickCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); } async run(msg, args) { diff --git a/commands/moderation/lockdown.js b/commands/moderation/lockdown.js index c2d53e73..1c5e2a16 100644 --- a/commands/moderation/lockdown.js +++ b/commands/moderation/lockdown.js @@ -23,7 +23,7 @@ module.exports = class LockdownCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('ADMINISTRATOR'); + return msg.member.hasPermission('ADMINISTRATOR'); } async run(msg, args) { diff --git a/commands/moderation/prune.js b/commands/moderation/prune.js index 30686c23..e1e6a98f 100644 --- a/commands/moderation/prune.js +++ b/commands/moderation/prune.js @@ -26,7 +26,7 @@ module.exports = class PruneCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('MANAGE_MESSAGES') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('MANAGE_MESSAGES') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); } async run(msg, args) { diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 7a017e6f..e0dec964 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -28,7 +28,7 @@ module.exports = class SoftbanCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); } async run(msg, args) { diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index ccd5a5db..65722639 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -35,7 +35,7 @@ module.exports = class UnbanCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); } async run(msg, args) { diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 07c87cbc..934863dc 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -27,7 +27,7 @@ module.exports = class WarnCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); } async run(msg, args) { diff --git a/commands/util/clearsetting.js b/commands/util/clearsetting.js index 79c0a31f..09c131df 100644 --- a/commands/util/clearsetting.js +++ b/commands/util/clearsetting.js @@ -22,7 +22,7 @@ module.exports = class ClearSettingCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('ADMINISTRATOR'); + return msg.member.hasPermission('ADMINISTRATOR'); } run(msg, args) { diff --git a/commands/util/memberchannel.js b/commands/util/memberchannel.js index 599a0103..b40063ea 100644 --- a/commands/util/memberchannel.js +++ b/commands/util/memberchannel.js @@ -17,7 +17,7 @@ module.exports = class MemberLogCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('ADMINISTRATOR'); + return msg.member.hasPermission('ADMINISTRATOR'); } run(msg, args) { diff --git a/commands/util/modchannel.js b/commands/util/modchannel.js index 581f50eb..a21c97d7 100644 --- a/commands/util/modchannel.js +++ b/commands/util/modchannel.js @@ -17,7 +17,7 @@ module.exports = class ModChannelCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('ADMINISTRATOR'); + return msg.member.hasPermission('ADMINISTRATOR'); } run(msg, args) { diff --git a/commands/util/staffrole.js b/commands/util/staffrole.js index 85dfedf0..af7b6533 100644 --- a/commands/util/staffrole.js +++ b/commands/util/staffrole.js @@ -17,7 +17,7 @@ module.exports = class StaffRoleCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('ADMINISTRATOR'); + return msg.member.hasPermission('ADMINISTRATOR'); } run(msg, args) { diff --git a/package.json b/package.json index 433cc5c6..a53d68e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "17.2.1", + "version": "17.2.2", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": {