diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 3283501d..0704890f 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -35,15 +35,15 @@ module.exports = class BanCommand extends Command { } hasPermission(msg) { - return msg.member.hasPermission('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('BAN_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole')); } async run(msg, args) { if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS')) return msg.say('This Command requires the `Ban Members` Permission.'); - const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs')); + const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog')); if (!modlogs) - return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.'); + return msg.say('This Command requires a channel set with the `modchannel` command.'); if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) return msg.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 8e71c07b..1e38b87e 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -32,15 +32,15 @@ module.exports = class KickCommand extends Command { } hasPermission(msg) { - return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole')); } async run(msg, args) { if (!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS')) return msg.say('This Command requires the `Kick Members` Permission.'); - const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs')); + const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog')); if (!modlogs) - return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.'); + return msg.say('This Command requires a channel set with the `modchannel` command.'); if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) return msg.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; diff --git a/commands/moderation/prune.js b/commands/moderation/prune.js index b577296c..b9c2f6d9 100644 --- a/commands/moderation/prune.js +++ b/commands/moderation/prune.js @@ -29,7 +29,7 @@ module.exports = class PruneCommand extends Command { } hasPermission(msg) { - return msg.member.hasPermission('MANAGE_MESSAGES') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('MANAGE_MESSAGES') || msg.member.roles.has(msg.guild.settings.get('staffRole')); } async run(msg, args) { diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index b4e1179a..91d143aa 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -32,7 +32,7 @@ module.exports = class SoftbanCommand extends Command { } hasPermission(msg) { - return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole')); } async run(msg, args) { @@ -40,9 +40,9 @@ module.exports = class SoftbanCommand extends Command { return msg.say('This Command requires the `Ban Members` Permission.'); if (!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS')) return msg.say('This Command requires the `Kick Members` Permission.'); - const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs')); + const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog')); if (!modlogs) - return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.'); + return msg.say('This Command requires a channel set with the `modchannel` command.'); if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) return msg.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index ec76cb1e..d637702e 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -39,15 +39,15 @@ module.exports = class UnbanCommand extends Command { } hasPermission(msg) { - return msg.member.hasPermission('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('BAN_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole')); } async run(msg, args) { if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS')) return msg.say('This Command requires the `Ban Members` Permission.'); - const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs')); + const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog', 'mod_logs')); if (!modlogs) - return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.'); + return msg.say('This Command requires a channel set with the `modchannel` command.'); if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) return msg.say('This Command requires the `Embed Links` Permission.'); const { id, reason } = args; diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 53992fc6..70b3c7d9 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -31,13 +31,13 @@ module.exports = class WarnCommand extends Command { } hasPermission(msg) { - return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff')); + return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole')); } async run(msg, args) { - const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs')); + const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog', 'mod_logs')); if (!modlogs) - return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.'); + return msg.say('This Command requires a channel set with the `modchannel` command.'); if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) return msg.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; diff --git a/commands/util/memberchannel.js b/commands/util/memberchannel.js index 4bc2456e..6b9517fe 100644 --- a/commands/util/memberchannel.js +++ b/commands/util/memberchannel.js @@ -24,7 +24,7 @@ module.exports = class MemberLogCommand extends Command { run(msg, args) { const { channel } = args; - msg.guild.settings.set('memberLog', channel.name); + msg.guild.settings.set('memberLog', channel.id); return msg.say(`Member Log channel set to ${channel.name}.`); } }; diff --git a/commands/util/modchannel.js b/commands/util/modchannel.js index 73964dfd..0968c823 100644 --- a/commands/util/modchannel.js +++ b/commands/util/modchannel.js @@ -24,7 +24,7 @@ module.exports = class ModChannelCommand extends Command { run(msg, args) { const { channel } = args; - msg.guild.settings.set('modLog', channel.name); + msg.guild.settings.set('modLog', channel.id); return msg.say(`Mod Log channel set to ${channel.name}.`); } }; diff --git a/commands/util/staffrole.js b/commands/util/staffrole.js index 21f599c5..d2393ac3 100644 --- a/commands/util/staffrole.js +++ b/commands/util/staffrole.js @@ -24,7 +24,7 @@ module.exports = class StaffRoleCommand extends Command { run(msg, args) { const { role } = args; - msg.guild.settings.set('staffRole', role.name); + msg.guild.settings.set('staffRole', role.id); return msg.say(`Server Staff role set to ${role.name}.`); } }; diff --git a/html/carbonuse.html b/html/carbonuse.html index cf38d111..619aba1c 100644 --- a/html/carbonuse.html +++ b/html/carbonuse.html @@ -11,8 +11,9 @@