aboutsummaryrefslogtreecommitdiff
path: root/commands/Pokemon
diff options
context:
space:
mode:
authorUnknown <jtsshieh@outlook.com>2018-03-18 19:53:23 -0400
committerUnknown <jtsshieh@outlook.com>2018-03-18 19:53:23 -0400
commit8fc8385b99883b97f17fe14dda97980a15f1311d (patch)
treea6807e3ae2b1064e0c50adeafa71ac579bdbd2d4 /commands/Pokemon
parentacc5cbb4c5e89386cec1952218d8be7a247432f2 (diff)
downloadPokeBot-8fc8385b99883b97f17fe14dda97980a15f1311d.tar.gz
PokeBot-8fc8385b99883b97f17fe14dda97980a15f1311d.tar.bz2
PokeBot-8fc8385b99883b97f17fe14dda97980a15f1311d.zip
testing
Diffstat (limited to 'commands/Pokemon')
-rw-r--r--commands/Pokemon/claim.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/commands/Pokemon/claim.js b/commands/Pokemon/claim.js
index b02cdd0..94e0064 100644
--- a/commands/Pokemon/claim.js
+++ b/commands/Pokemon/claim.js
@@ -39,7 +39,7 @@ exports.run = async (bot, msg) => {
const owner = msg.channel.topic.slice(15).substring(0, 18);
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.');
msg.channel.send('<@' + owner + '>, come here as ' + msg.member.displayName + ' wants to battle you.');
- bot.on('message', async mess => {
+ const func = async mess => {
if (mess.channel != msg.channel) return;
let field = mess.embeds[0];
if (!field) return;
@@ -53,7 +53,7 @@ exports.run = async (bot, msg) => {
if (user != undefined) {
if (user.id == owner) {
await msg.channel.send('The owner has not been defeated!');
- bot.removeListener('message', this);
+ bot.removeListener('message', func);
}
if (user.id == msg.author.id) {
await msg.channel.send('The owner has been defeated! Transfaring gym!');
@@ -62,11 +62,12 @@ exports.run = async (bot, msg) => {
if (msg.member.roles.find('name', 'Rocket')) recipientTeam = 'Rocket';
if (msg.member.roles.find('name', 'Magma')) recipientTeam = 'Magma';
await msg.channel.setTopic('Current Owner: ' + msg.member.id + '/' + msg.author.tag + '/' + recipientTeam);
- bot.removeListener('message', this);
+ bot.removeListener('message', func);
}
}
}
- });
+ };
+ bot.on('message', func);
}
};