aboutsummaryrefslogtreecommitdiff
path: root/commands/join.js
diff options
context:
space:
mode:
authorUnknown <jtsshieh@outlook.com>2018-02-24 14:59:35 -0500
committerUnknown <jtsshieh@outlook.com>2018-02-24 14:59:35 -0500
commitc484753ee15dbe2a5ce9c6297f22fabb52ce3b7e (patch)
tree93fd74f30abbd3c8206321b9d9c20b2571ed84ca /commands/join.js
parent3d36bcf0591f2694c3a2472a157ecca0de8d35fc (diff)
downloadPokeBot-c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e.tar.gz
PokeBot-c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e.tar.bz2
PokeBot-c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e.zip
New Command system
Diffstat (limited to 'commands/join.js')
-rw-r--r--commands/join.js61
1 files changed, 0 insertions, 61 deletions
diff --git a/commands/join.js b/commands/join.js
deleted file mode 100644
index dc3ba84..0000000
--- a/commands/join.js
+++ /dev/null
@@ -1,61 +0,0 @@
-exports.run = async (bot, msg, args) => {
- if (args.length < 1) return msg.reply('Please choose a team to join');
-
- const team = findTeam(msg, args[0]);
- switch(args[0])
- {
- case 'mystic': {
- msg.member.addRole(msg.guild.roles.find('name', 'Mystic'));
- msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Mystic.`);
- break;
- }
- case 'valor' : {
- msg.member.addRole(msg.guild.roles.find('name', 'Valor'));
- msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Valor.`);
- break;
- }
- case 'instinct' : {
- msg.member.addRole(msg.guild.roles.find('name', 'Instinct'));
- msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Instinct.`);
- break;
- }
- default : {
- msg.reply('You have to pick, mystic, valor, or instinct.');
- break;
- }
- }
-};
-
-function findTeam(msg, team) {
-
- let oldTeam;
-
- if (msg.member.roles.find('name', 'Mystic')) {
- if (team == 'mystic') return;
- msg.member.removeRole(msg.guild.roles.find('name', 'Mystic'));
- oldTeam = 'Mystic';
- }
- else if (msg.member.roles.find('name', 'Valor')) {
- if (team == 'valor') return;
- msg.member.removeRole(msg.guild.roles.find('name', 'Valor'));
- oldTeam = 'Valor';
- }
- else if (msg.member.roles.find('name', 'Instinct')) {
- if (team == 'instinct') return;
- msg.member.removeRole(msg.guild.roles.find('name', 'Instinct'));
- oldTeam = 'Instinct';
- }
- return oldTeam;
-}
-
-exports.conf = {
- aliases: ['pick', 'choose'],
- guildOnly: true,
-};
-
-exports.help = {
- name: 'join',
- description: 'Join one of the teams!',
- usage: '<mystic/valor/instinct>',
- category: 'Teams',
-};