mirror of
https://github.com/yuzu-emu/Command-fix
synced 2024-11-24 23:08:09 +00:00
Added grantDeveloper command.
This commit is contained in:
parent
bcc9afbd71
commit
84ed2dd105
2 changed files with 18 additions and 15 deletions
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 a new issue