This commit is contained in:
pokesudenk 2018-02-24 13:01:04 -05:00
commit 7d51de6816

View file

@ -1,32 +1,35 @@
exports.run = async (bot, msg, args) => {
if (args.length < 1) return msg.reply('Please choose a team to join');
let team;
if (msg.member.roles.find('name', 'Mystic')) {
msg.member.removeRole(msg.guild.roles.find('name', 'Mystic'));
msg.reply('You have left team Mystic.');
team = 'Mystic';
}
else if (msg.member.roles.find('name', 'Valor')) {
msg.member.removeRole(msg.guild.roles.find('name', 'Valor'));
msg.reply('You have left team Valor.');
team = 'Valor';
}
else if (msg.member.roles.find('name', 'Instinct')) {
msg.member.removeRole(msg.guild.roles.find('name', 'Instinct'));
msg.reply('You have left team Instinct.');
team = 'Instinct';
}
switch(args[0])
{
case 'mystic': {
msg.member.addRole(msg.guild.roles.find('name', 'Mystic'));
msg.reply('Alright, you are have joined team Mystic.');
msg.reply(`Alright, ${team ? 'you have left team ' + team + 'and ' : 'you are have '}joined team Mystic.`);
break;
}
case 'valor' : {
msg.member.addRole(msg.guild.roles.find('name', 'Valor'));
msg.reply('Alright, you have joined team Valor.');
msg.reply(`Alright, ${team ? 'you have left team ' + team + 'and ' : 'you are have '}joined team Valor.`);
break;
}
case 'instinct' : {
msg.member.addRole(msg.guild.roles.find('name', 'Instinct'));
msg.reply('Alright, you have joined team Instinct.');
msg.reply(`Alright, ${team ? 'you have left team ' + team + 'and ' : 'you are have '}joined team Instinct.`);
break;
}
default : {
@ -37,7 +40,7 @@ exports.run = async (bot, msg, args) => {
};
exports.conf = {
aliases: [],
aliases: ['pick'],
guildOnly: true,
};