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/Getting Started/start.js | 2 +- 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 ++++++++++++++++++++++ 7 files changed, 135 insertions(+), 135 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') diff --git a/commands/Getting Started/start.js b/commands/Getting Started/start.js index e24ca70..aa8eb9f 100644 --- a/commands/Getting Started/start.js +++ b/commands/Getting Started/start.js @@ -15,7 +15,7 @@ exports.run = (bot, msg) => { .setColor(0x00ae86) .setTitle('Getting Started in PokeWorld') .addField('PokeCord', 'First off, we need to get you up and running in PokeCord!\n\nMake sure to use the `p!start` command to pick a starter pokemon. Once you have done that, you can start using PokeCord related features in the server!') - .addField('Teams // Gyms', 'Next, you may join a team using PokeBot. To do this, run the `join` command followed by the team you want to join. You can join `flare` or `skull`. Now, you can start claiming gyms. To do this, run `p:claim` in a gym channel. If no one owns it, the gym will now be yours. However if someone does own it, it will either tell you to lay off (if your team owns the gym), or it will ping the owner of the gym and tell them to battle you. If you lose said battle, you will not recieve the gym. Otherwise, the owner of the gym will have to drop it for you to claim. You can also trade gyms with other members using the `tradegym` command.') + .addField('Teams // Gyms', 'Next, you may join a team using PokeBot. To do this, run the `jointeam` command followed by the team you want to join. You can join `flare` or `skull`. Now, you can start claiming gyms. To do this, run `p:claim` in a gym channel. If no one owns it, the gym will now be yours. However if someone does own it, it will either tell you to lay off (if your team owns the gym), or it will ping the owner of the gym and tell them to battle you. If you lose said battle, you will not recieve the gym. Otherwise, the owner of the gym will have to drop it for you to claim. You can also trade gyms with other members using the `tradegym` command.') .addField('The End of the Introduction', 'Now that you have done all of this, you are ready to start your journey in the digital region! Chat with people, make friends, and most importantly, have fun!\n\n-The official "sentience" of the PokeWorld server!') .setFooter('PokeBot v1.0') ); 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