aboutsummaryrefslogtreecommitdiff
path: root/commands/Pokemon
diff options
context:
space:
mode:
authorTheEdgeNK <trey6979@gmail.com>2018-07-10 18:36:51 -0400
committerTheEdgeNK <trey6979@gmail.com>2018-07-10 18:36:51 -0400
commit96bdf46414fe806a19fa5070148fc4925be007d8 (patch)
tree137249477c654fce293554c9cc0c6387bc066701 /commands/Pokemon
parentc648f47f889ee2dbfae0c896493c13efcd295b99 (diff)
downloadPokeBot-96bdf46414fe806a19fa5070148fc4925be007d8.tar.gz
PokeBot-96bdf46414fe806a19fa5070148fc4925be007d8.tar.bz2
PokeBot-96bdf46414fe806a19fa5070148fc4925be007d8.zip
hOLY
Diffstat (limited to 'commands/Pokemon')
-rw-r--r--commands/Pokemon/claim.js67
-rw-r--r--commands/Pokemon/drop.js37
-rw-r--r--commands/Pokemon/forcedrop.js33
-rw-r--r--commands/Pokemon/joinalliance.js62
-rw-r--r--commands/Pokemon/leavealliance.js35
-rw-r--r--commands/Pokemon/lsitem.js41
-rw-r--r--commands/Pokemon/tradegym.js42
7 files changed, 0 insertions, 317 deletions
diff --git a/commands/Pokemon/claim.js b/commands/Pokemon/claim.js
deleted file mode 100644
index e76c2a7..0000000
--- a/commands/Pokemon/claim.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/** **************************************
- *
- * Claim: 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 is a Whiltelisted command. 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 (!bot.plugins.gyms.isOwned(msg.channel.topic)) {
- const team = bot.plugins.gyms.getTeam(msg.member);
- if (!team) return msg.reply('You have to join a team before you can claim a gym.');
- msg.reply('Alright, you have claimed this gym as yours! Be ready to battle anyone who approaches you');
- return msg.channel.setTopic(bot.plugins.gyms.getGymString(bot, msg.member));
- }
-
- const team = bot.plugins.gyms.getTeam(msg.member);
- if (!team) return msg.reply('You have to join a team before you can claim a gym.');
-
- const owner = bot.plugins.gyms.getOwnerId(msg.channel.topic);
- if (msg.guild.members.find('id', owner).roles.find('name', team)) return msg.reply('Don\'t try battling your own team. They won\'t like you.');
-
- if (bot.gyms.get(msg.channel.id) != null) return msg.reply('Nope, someone is already battling the gym.');
-
- msg.channel.send('<@' + owner + '>, come here as ' + msg.member.displayName + ' wants to battle you.');
-
- const func = async mess => {
- if (mess.channel != msg.channel) return;
- if (!mess.embeds[0] &&
- !mess.embeds[0].description &&
- !mess.embeds[0].description.split('\n')[0] &&
- !mess.embeds[0].description.split('\n')[0].split(' ')[0]
- ) return;
-
- const field = mess.embeds[0].description.split('\n')[0].split(' ')[0];
- const user = msg.guild.members.find(member => member.user.username === field);
- if (!user) return;
- if (user.id == owner) {
- await msg.channel.send('The owner has not been defeated!');
- }
- else if (user.id == msg.author.id) {
- await msg.channel.send('The owner has been defeated! Transferring gym!');
- await msg.channel.setTopic(bot.plugins.gyms.getGymString(bot, msg.member));
- }
- else { return; }
- bot.gyms.set(msg.channel.id, null);
- bot.removeListener('message', func);
- };
- bot.gyms.set(msg.channel.id, func);
- bot.on('message', func);
-};
-
-exports.conf = {
- aliases: [],
- guildOnly: true,
-};
-
-exports.help = {
- name: 'claim',
- description: 'Claim a gym.',
-};
diff --git a/commands/Pokemon/drop.js b/commands/Pokemon/drop.js
deleted file mode 100644
index 3b2bf97..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 is a Whiltelisted command. 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/forcedrop.js b/commands/Pokemon/forcedrop.js
deleted file mode 100644
index 50a9acf..0000000
--- a/commands/Pokemon/forcedrop.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/** **************************************
- *
- * Ban: 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 is a Whiltelisted command. Only whitelisted servers can use this command. Sorry!');
-
- if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permssion to ban members.');
- 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('This gym does not have an owner.');
- }
- else {
- msg.channel.setTopic('Current Owner: *none*');
- msg.channel.send('You have dropped the gym.');
- }
-};
-
-exports.conf = {
- aliases: [],
- guildOnly: true,
-};
-
-exports.help = {
- name: 'forcedrop',
- description: 'Force a gym to have no owner.',
-};
diff --git a/commands/Pokemon/joinalliance.js b/commands/Pokemon/joinalliance.js
deleted file mode 100644
index e2d9940..0000000
--- a/commands/Pokemon/joinalliance.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 is a Whiltelisted command. Only whitelisted servers can use this command. Sorry!');
-
- if (args.length < 1) return msg.reply('You did not pick an existing alliance. The list of alliances are as follows:\nDarkSide, Skull');
-
- const team = findTeam(msg, args[0]);
- 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 the alliance 'Skull'.`);
- break;
- }
- case 'DarkSide' : {
- msg.member.addRole(msg.guild.roles.find('name', 'Dark Side'));
- msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined the alliance 'Dark Side'.`);
- break;
- }
- default : {
- msg.reply('You did not pick an existing alliance. The list of alliances are as follows:\nDarkSide, Skull');
- 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', 'Dark Side')) {
- if (team == 'DarkSide') return;
- msg.member.removeRole(msg.guild.roles.find('name', 'DarkSide'));
- oldTeam = 'DarkSide';
- }
- return oldTeam;
-}
-
-exports.conf = {
- aliases: ['pick', 'choose'],
- guildOnly: true,
-};
-
-exports.help = {
- name: 'joinalliance',
- description: 'Join one of the alliances!',
- usage: '<alliance name>',
-};
diff --git a/commands/Pokemon/leavealliance.js b/commands/Pokemon/leavealliance.js
deleted file mode 100644
index dd511c7..0000000
--- a/commands/Pokemon/leavealliance.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 is a Whiltelisted command. 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 the alliance `Skull`.');
- }
- else if (msg.member.roles.find('name', 'Dark Side')) {
- msg.member.removeRole(msg.guild.roles.find('name', 'Dark Side'));
- msg.reply('Alright, you are not longer in the alliance `Dark Side`.');
- }
- else {
- msg.reply('You are not in a team.');
- }
-};
-
-exports.conf = {
- aliases: [],
- guildOnly: true,
-};
-
-exports.help = {
- name: 'leavealliance',
- description: 'Leave the alliance you currently are in.',
-};
diff --git a/commands/Pokemon/lsitem.js b/commands/Pokemon/lsitem.js
deleted file mode 100644
index dd628ae..0000000
--- a/commands/Pokemon/lsitem.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/** **************************************
- *
- * LSItem: Plugin for lists an item for sale in the marketplace
- * Copyright (C) 2018 TheEdge, jtsshieh, Alee
- *
- * Licensed under the Open Software License version 3.0
- *
- * *************************************/
-
-exports.run = async (bot, msg, args) => {
- if (msg.guild.id != '417088992329334792') return msg.reply ('This is a PokeWorld exclusive command. Sorry!');
-
- const { RichEmbed } = require('discord.js');
- const data = args.join(' ').split('|');
- const msgs = await bot.channels.find('id', '428738848420397057').fetchMessages({ limit: 10 });
- const mess = msgs.first();
- if (!mess.embeds) return;
- const id = parseInt(mess.embeds[0].author.name.split(':')[1]) + 1;
-
- bot.channels.find('id', '428738848420397057').send(
- new RichEmbed()
- .setTitle('A new pokemon is up for sale!')
- .setAuthor('ID: ' + id)
- .addField('Starting Price', data[1], true)
- .addField('Pokemon', data[0], true)
- .addField('Other', data[2], true)
- .addField('Seller', `<@${msg.author.id}>`, true)
- .addField('How to bid', 'DM the seller for the pokemon giving them the id, ' + id)
- );
-};
-
-exports.conf = {
- aliases: [],
- guildOnly: true,
-};
-
-exports.help = {
- name: 'lsitem',
- description: 'List an item to the marketplace.',
- usage: '<pokemon>|<credits>|<other>',
-};
diff --git a/commands/Pokemon/tradegym.js b/commands/Pokemon/tradegym.js
deleted file mode 100644
index e195b62..0000000
--- a/commands/Pokemon/tradegym.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/** **************************************
- *
- * TradeGym: 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 is a Whiltelisted command. 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.');
- let team;
- if (msg.member.roles.find('name', 'Skull')) team = 'Skull';
- if (msg.member.roles.find('name', 'Flare')) team = 'Flare';
- if (msg.channel.topic == 'Current Owner: ' + msg.author.id + '/' + msg.author.tag + '/' + team) {
- if (!msg.mentions.members.first()) return msg.reply('Sorry, you have to ping the recipient of the gym!');
- const recipient = msg.mentions.members.first();
-
- msg.reply('Trading gym to ' + recipient);
- let recipientTeam;
- if (recipient.roles.find('name', 'Skull')) recipientTeam = 'Skull';
- if (recipient.roles.find('name', 'Flare')) recipientTeam = 'Flare';
- msg.channel.setTopic('Current Owner: ' + recipient.id + '/' + recipient.user.tag + '/' + recipientTeam);
- }
- else {
- msg.reply('You have to own the gym to be able to trade it!');
- }
-};
-
-exports.conf = {
- aliases: [],
- guildOnly: true,
-};
-
-exports.help = {
- name: 'tradegym',
- description: 'Trade a gym to the pinged member.',
- usage: '@user',
-};