diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-24 12:56:22 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-24 12:56:22 -0500 |
| commit | 0a37a04e7d5be6342189ddf229ab718d538b1c02 (patch) | |
| tree | 8823471c57be652f3b2f26f018694296fcaf36d1 /commands/join.js | |
| parent | 99252aef92aeb9157f597dd66bcc368dbe706a7d (diff) | |
| download | PokeBot-0a37a04e7d5be6342189ddf229ab718d538b1c02.tar.gz PokeBot-0a37a04e7d5be6342189ddf229ab718d538b1c02.tar.bz2 PokeBot-0a37a04e7d5be6342189ddf229ab718d538b1c02.zip | |
Fix join
Diffstat (limited to 'commands/join.js')
| -rw-r--r-- | commands/join.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/commands/join.js b/commands/join.js index 2e431b0..3b8239c 100644 --- a/commands/join.js +++ b/commands/join.js @@ -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, }; |
