From 16e180ea0337fa0b4a76fb59c29a629344c1d4d4 Mon Sep 17 00:00:00 2001 From: chris062689 Date: Thu, 10 Aug 2017 20:12:47 -0400 Subject: [PATCH] Using the member object instead of the direct user. --- commands/grantDeveloper.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/grantDeveloper.js b/commands/grantDeveloper.js index 7999c71..34bc800 100644 --- a/commands/grantDeveloper.js +++ b/commands/grantDeveloper.js @@ -5,13 +5,14 @@ exports.roles = ['Admins', 'Moderators', 'CitraBot']; exports.command = function(message) { var role = '345247291843805185'; message.mentions.users.map((user) => { - var alreadyJoined = app.guild.roles.get(role).members.find(member => member.id == user.id); + let member = message.guild.member(user); + let alreadyJoined = member.roles.has(role.id); if (alreadyJoined != null) { - user.removeRole(role); + member.removeRole(role); message.reply(`${user}'s speech has been revoked in the #development channel.`); } else { - user.addRole(role); + member.addRole(role); message.reply(`${user} has been granted speech in the #development channel.`); } });