aboutsummaryrefslogtreecommitdiff
path: root/commands/Pokemon/jointeam.js
diff options
context:
space:
mode:
authorJustin <jtsshieh@outlook.com>2019-11-02 11:02:19 -0400
committerJustin <jtsshieh@outlook.com>2019-11-02 11:02:19 -0400
commit7031fa12ba79281edc49df972311c13ad0e8fa53 (patch)
tree60410a33fe45add85a9dc962c975be478f3f8cff /commands/Pokemon/jointeam.js
parent106530d5dc53166632a6a0ecc8930eb2b1ed4bfd (diff)
downloadPokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.gz
PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.bz2
PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.zip
es-lint settings added + linted all files
Diffstat (limited to 'commands/Pokemon/jointeam.js')
-rw-r--r--commands/Pokemon/jointeam.js54
1 files changed, 30 insertions, 24 deletions
diff --git a/commands/Pokemon/jointeam.js b/commands/Pokemon/jointeam.js
index e396afe..d4f125f 100644
--- a/commands/Pokemon/jointeam.js
+++ b/commands/Pokemon/jointeam.js
@@ -9,27 +9,30 @@
exports.run = async (bot, msg, args) => {
const isWhitelist = await bot.plugins.whitelist.isWhitelist(msg.guild.id);
- if (!isWhitelist) return msg.reply ('This command is still in testing. Only whitelisted servers can use this command. Sorry!');
+ if (!isWhitelist) {
+ return msg.reply('This command is still in testing. Only whitelisted servers can use this command. Sorry!');
+ }
- if (args.length < 1) return msg.reply('Please choose a team to join');
+ if (args.length < 1) {
+ return msg.reply('Please choose a team to join');
+ }
const team = findTeam(msg, args[0].toUpperCase());
- switch (args[0])
- {
- case 'skull': {
- msg.member.addRole(msg.guild.roles.find('name', 'Skull'));
- msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Skull.`);
- break;
- }
- case 'flare' : {
- msg.member.addRole(msg.guild.roles.find('name', 'Flare'));
- msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Flare.`);
- break;
- }
- default : {
- msg.reply('You have to pick a team (skull, flare.)');
- break;
- }
+ switch (args[0]) {
+ case 'skull': {
+ msg.member.addRole(msg.guild.roles.find('name', 'Skull'));
+ msg.reply(`Alright, ${team ? `you have left team ${ team } and ` : 'you have '}joined team Skull.`);
+ break;
+ }
+ case 'flare' : {
+ msg.member.addRole(msg.guild.roles.find('name', 'Flare'));
+ msg.reply(`Alright, ${team ? `you have left team ${ team } and ` : 'you have '}joined team Flare.`);
+ break;
+ }
+ default : {
+ msg.reply('You have to pick a team (skull, flare.)');
+ break;
+ }
}
};
@@ -38,12 +41,15 @@ function findTeam(msg, team) {
let oldTeam;
if (msg.member.roles.find('name', 'Skull')) {
- if (team == 'skull') return;
+ if (team == 'skull') {
+ return;
+ }
msg.member.removeRole(msg.guild.roles.find('name', 'Skull'));
oldTeam = 'Skull';
- }
- else if (msg.member.roles.find('name', 'Flare')) {
- if (team == 'flare') return;
+ } else if (msg.member.roles.find('name', 'Flare')) {
+ if (team == 'flare') {
+ return;
+ }
msg.member.removeRole(msg.guild.roles.find('name', 'Flare'));
oldTeam = 'Flare';
}
@@ -52,11 +58,11 @@ function findTeam(msg, team) {
exports.conf = {
aliases: ['pick', 'choose'],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'jointeam',
description: 'Join one of the teams!',
- usage: '<flare/skull>',
+ usage: '<flare/skull>'
};