diff --git a/commands/grantDeveloper.js b/commands/grantDeveloper.js new file mode 100644 index 0000000..7999c71 --- /dev/null +++ b/commands/grantDeveloper.js @@ -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.`); + } + }); +} diff --git a/commands/testing.disabled.js b/commands/testing.disabled.js deleted file mode 100644 index 72d00ed..0000000 --- a/commands/testing.disabled.js +++ /dev/null @@ -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.'); - } -}