Added grantDeveloper command.

This commit is contained in:
chris062689 2017-08-10 20:04:55 -04:00
parent bcc9afbd71
commit 84ed2dd105
2 changed files with 18 additions and 15 deletions

View File

@ -0,0 +1,18 @@
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) => {
var alreadyJoined = app.guild.roles.get(role).members.find(member => member.id == user.id);
if (alreadyJoined != null) {
user.removeRole(role);
message.reply(`${user}'s speech has been revoked in the #development channel.`);
} else {
user.addRole(role);
message.reply(`${user} has been granted speech in the #development channel.`);
}
});
}

View File

@ -1,15 +0,0 @@
var app = require('../app.js');
var logger = require('../logging.js');
exports.command = function(message) {
var role = '254036987508424714';
var alreadyJoined = app.guild.roles.get(role).members.find(member => member.id == message.member.id);
if (alreadyJoined != null) {
message.member.removeRole(role);
message.reply('You are no longer part of the testing group.');
} else {
message.member.addRole(role);
message.reply('You are now part of the testing group.');
}
}