From 106530d5dc53166632a6a0ecc8930eb2b1ed4bfd Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 1 Nov 2019 18:36:12 -0400 Subject: Changed some command names and added a sh script --- commands/Pokemon/drop.js | 37 -------------------------- commands/Pokemon/dropgym.js | 37 ++++++++++++++++++++++++++ commands/Pokemon/join.js | 62 ------------------------------------------- commands/Pokemon/jointeam.js | 62 +++++++++++++++++++++++++++++++++++++++++++ commands/Pokemon/leave.js | 35 ------------------------ commands/Pokemon/leaveteam.js | 35 ++++++++++++++++++++++++ 6 files changed, 134 insertions(+), 134 deletions(-) delete mode 100644 commands/Pokemon/drop.js create mode 100644 commands/Pokemon/dropgym.js delete mode 100644 commands/Pokemon/join.js create mode 100644 commands/Pokemon/jointeam.js delete mode 100644 commands/Pokemon/leave.js create mode 100644 commands/Pokemon/leaveteam.js (limited to 'commands/Pokemon') diff --git a/commands/Pokemon/drop.js b/commands/Pokemon/drop.js deleted file mode 100644 index 555213e..0000000 --- a/commands/Pokemon/drop.js +++ /dev/null @@ -1,37 +0,0 @@ -/** ************************************** - * - * Drop: Plugin for PokeBot that powers the PokeWorld gym system. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -exports.run = async (bot, msg) => { - 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 (!msg.channel.name.startsWith('gym-')) return msg.reply('Go into one of the gym channels and try again.'); - if (msg.channel.topic == 'Current Owner: *none*') { - msg.reply('There is no owner for this gym. Claim it now with p:claim!'); - } - else { - const owner = msg.channel.topic.slice(15).substring(0, 18); - if (msg.author.id != owner) { - return msg.reply('You are not the owner of this gym.'); - } - else { - msg.channel.setTopic('Current Owner: *none*'); - msg.channel.send('You have dropped the gym.'); - } - } -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'drop', - description: 'Drop a gym.', -}; diff --git a/commands/Pokemon/dropgym.js b/commands/Pokemon/dropgym.js new file mode 100644 index 0000000..cb9ad2e --- /dev/null +++ b/commands/Pokemon/dropgym.js @@ -0,0 +1,37 @@ +/** ************************************** + * + * Drop: Plugin for PokeBot that powers the PokeWorld gym system. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +exports.run = async (bot, msg) => { + 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 (!msg.channel.name.startsWith('gym-')) return msg.reply('Go into one of the gym channels and try again.'); + if (msg.channel.topic == 'Current Owner: *none*') { + msg.reply('There is no owner for this gym. Claim it now with p:claim!'); + } + else { + const owner = msg.channel.topic.slice(15).substring(0, 18); + if (msg.author.id != owner) { + return msg.reply('You are not the owner of this gym.'); + } + else { + msg.channel.setTopic('Current Owner: *none*'); + msg.channel.send('You have dropped the gym.'); + } + } +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'dropgym', + description: 'Drop a gym.', +}; diff --git a/commands/Pokemon/join.js b/commands/Pokemon/join.js deleted file mode 100644 index 59bc0c7..0000000 --- a/commands/Pokemon/join.js +++ /dev/null @@ -1,62 +0,0 @@ -/** ************************************** - * - * Join: Plugin for PokeBot that powers the PokeWorld team system. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -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 (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; - } - } -}; - -function findTeam(msg, team) { - - let oldTeam; - - if (msg.member.roles.find('name', 'Skull')) { - 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; - msg.member.removeRole(msg.guild.roles.find('name', 'Flare')); - oldTeam = 'Flare'; - } - return oldTeam; -} - -exports.conf = { - aliases: ['pick', 'choose'], - guildOnly: true, -}; - -exports.help = { - name: 'join', - description: 'Join one of the teams!', - usage: '', -}; diff --git a/commands/Pokemon/jointeam.js b/commands/Pokemon/jointeam.js new file mode 100644 index 0000000..e396afe --- /dev/null +++ b/commands/Pokemon/jointeam.js @@ -0,0 +1,62 @@ +/** ************************************** + * + * Join: Plugin for PokeBot that powers the PokeWorld team system. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +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 (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; + } + } +}; + +function findTeam(msg, team) { + + let oldTeam; + + if (msg.member.roles.find('name', 'Skull')) { + 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; + msg.member.removeRole(msg.guild.roles.find('name', 'Flare')); + oldTeam = 'Flare'; + } + return oldTeam; +} + +exports.conf = { + aliases: ['pick', 'choose'], + guildOnly: true, +}; + +exports.help = { + name: 'jointeam', + description: 'Join one of the teams!', + usage: '', +}; diff --git a/commands/Pokemon/leave.js b/commands/Pokemon/leave.js deleted file mode 100644 index 397cecb..0000000 --- a/commands/Pokemon/leave.js +++ /dev/null @@ -1,35 +0,0 @@ -/** ************************************** - * - * Leave: Plugin for PokeBot that powers the PokeWorld team system. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -exports.run = async (bot, msg) => { - 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 (msg.member.roles.find('name', 'Skull')) { - msg.member.removeRole(msg.guild.roles.find('name', 'Skull')); - msg.reply('Alright, you are not longer in team Skull.'); - } - else if (msg.member.roles.find('name', 'Flare')) { - msg.member.removeRole(msg.guild.roles.find('name', 'Flare')); - msg.reply('Alright, you are not longer in team Flare.'); - } - else { - msg.reply('You are not in a team.'); - } -}; - -exports.conf = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'leave', - description: 'Leave the team you currently are in.', -}; diff --git a/commands/Pokemon/leaveteam.js b/commands/Pokemon/leaveteam.js new file mode 100644 index 0000000..b2e1805 --- /dev/null +++ b/commands/Pokemon/leaveteam.js @@ -0,0 +1,35 @@ +/** ************************************** + * + * Leave: Plugin for PokeBot that powers the PokeWorld team system. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +exports.run = async (bot, msg) => { + 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 (msg.member.roles.find('name', 'Skull')) { + msg.member.removeRole(msg.guild.roles.find('name', 'Skull')); + msg.reply('Alright, you are not longer in team Skull.'); + } + else if (msg.member.roles.find('name', 'Flare')) { + msg.member.removeRole(msg.guild.roles.find('name', 'Flare')); + msg.reply('Alright, you are not longer in team Flare.'); + } + else { + msg.reply('You are not in a team.'); + } +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'leaveteam', + description: 'Leave the team you currently are in.', +}; -- cgit v1.2.3