mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-25 02:15:40 +01:00
Added grantDeveloper command.
This commit is contained in:
parent
bcc9afbd71
commit
84ed2dd105
18
commands/grantDeveloper.js
Normal file
18
commands/grantDeveloper.js
Normal 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.`);
|
||||
}
|
||||
});
|
||||
}
|
@ -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.');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user