Command-fix/commands/grantDeveloper.js

20 lines
628 B
JavaScript
Raw Normal View History

2017-08-11 02:04:55 +02: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.id);
2017-08-11 02:04:55 +02:00
if (alreadyJoined != null) {
member.removeRole(role);
2017-08-11 02:04:55 +02:00
message.reply(`${user}'s speech has been revoked in the #development channel.`);
} else {
member.addRole(role);
2017-08-11 02:04:55 +02:00
message.reply(`${user} has been granted speech in the #development channel.`);
}
});
}