Command-fix/commands/grantDeveloper.js

20 lines
645 B
JavaScript
Raw Normal View History

2017-08-10 20:04:55 -04:00
var app = require('../app.js');
var logger = require('../logging.js');
exports.roles = ['Admins', 'Moderators', 'CitraBot'];
exports.command = function(message) {
var role = '345247291843805185';
message.mentions.users.map((user) => {
let member = message.guild.member(user);
let alreadyJoined = member.roles.has(role);
2017-08-10 20:04:55 -04:00
if (alreadyJoined) {
member.removeRole(role);
message.channel.sendMessage(`${user}'s speech has been revoked in the #development channel.`);
2017-08-10 20:04:55 -04:00
} else {
member.addRole(role);
message.channel.sendMessage(`${user} has been granted speech in the #development channel.`);
2017-08-10 20:04:55 -04:00
}
});
}