From b7693b291691e1450ad22faaa2a30af179c43b1d Mon Sep 17 00:00:00 2001 From: chris062689 Date: Thu, 10 Aug 2017 20:14:51 -0400 Subject: [PATCH] Corrected alreadyJoined to point to the role ID, corrected if statement to account for a boolean. Using sendMessage instead of reply. --- commands/grantDeveloper.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/grantDeveloper.js b/commands/grantDeveloper.js index 34bc800..66e6e0a 100644 --- a/commands/grantDeveloper.js +++ b/commands/grantDeveloper.js @@ -6,14 +6,14 @@ exports.command = function(message) { var role = '345247291843805185'; message.mentions.users.map((user) => { let member = message.guild.member(user); - let alreadyJoined = member.roles.has(role.id); + let alreadyJoined = member.roles.has(role); - if (alreadyJoined != null) { + if (alreadyJoined) { member.removeRole(role); - message.reply(`${user}'s speech has been revoked in the #development channel.`); + message.channel.sendMessage(`${user}'s speech has been revoked in the #development channel.`); } else { member.addRole(role); - message.reply(`${user} has been granted speech in the #development channel.`); + message.channel.sendMessage(`${user} has been granted speech in the #development channel.`); } }); }