From c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 Feb 2018 14:59:35 -0500 Subject: New Command system --- commands/join.js | 61 -------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 commands/join.js (limited to 'commands/join.js') 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: '', - category: 'Teams', -}; -- cgit v1.2.3