mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-12-22 23:55:29 +00: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';
|
var role = '345247291843805185';
|
||||||
message.mentions.users.map((user) => {
|
message.mentions.users.map((user) => {
|
||||||
let member = message.guild.member(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);
|
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 {
|
} else {
|
||||||
member.addRole(role);
|
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 a new issue