mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-25 04:15:41 +01:00
Corrected alreadyJoined to point to the role ID, corrected if statement to account for a boolean. Using sendMessage instead of reply.
This commit is contained in:
parent
a13f00e18c
commit
b7693b2916
@ -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.`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user