From 84ed2dd105ff985fc2dcc75c772db1f18714d6ab Mon Sep 17 00:00:00 2001 From: chris062689 Date: Thu, 10 Aug 2017 20:04:55 -0400 Subject: [PATCH] Added grantDeveloper command. --- commands/grantDeveloper.js | 18 ++++++++++++++++++ commands/testing.disabled.js | 15 --------------- 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 commands/grantDeveloper.js delete mode 100644 commands/testing.disabled.js 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.'); - } -}