aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpokesudenk <thisis@notarealema.il>2018-02-24 13:01:04 -0500
committerpokesudenk <thisis@notarealema.il>2018-02-24 13:01:04 -0500
commit7d51de6816b53df9d94105553afb956f66e57234 (patch)
tree70575d230f7fc94ab0028748d92eccc477d9a196
parent1339b0879a1059e9bf833273e61d522dc752d534 (diff)
parent0a37a04e7d5be6342189ddf229ab718d538b1c02 (diff)
downloadPokeBot-7d51de6816b53df9d94105553afb956f66e57234.tar.gz
PokeBot-7d51de6816b53df9d94105553afb956f66e57234.tar.bz2
PokeBot-7d51de6816b53df9d94105553afb956f66e57234.zip
Merge branch 'master' of https://github.com/PokeWorld/PokeBot
-rw-r--r--commands/join.js17
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,
};