aboutsummaryrefslogtreecommitdiff
path: root/commands/Pokemon
diff options
context:
space:
mode:
authorTrey-Server <trey6979@gmail.com>2018-03-19 00:10:51 +0000
committerTrey-Server <trey6979@gmail.com>2018-03-19 00:10:51 +0000
commit62172685f32f8d4262d15528eaae8a8af2d85d24 (patch)
treebab4216bf721502ee74882b288d1655f180b4acb /commands/Pokemon
parent3f196569f0b2f2bab12728574398177f8665a3ec (diff)
parentc0bbf4e2183735bc7eb65a255eccc09f127a160d (diff)
downloadPokeBot-62172685f32f8d4262d15528eaae8a8af2d85d24.tar.gz
PokeBot-62172685f32f8d4262d15528eaae8a8af2d85d24.tar.bz2
PokeBot-62172685f32f8d4262d15528eaae8a8af2d85d24.zip
Merge branch 'master' of https://github.com/PokeWorld/PokeBot
Diffstat (limited to 'commands/Pokemon')
-rw-r--r--commands/Pokemon/claim.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/commands/Pokemon/claim.js b/commands/Pokemon/claim.js
index b0b6f2f..94e0064 100644
--- a/commands/Pokemon/claim.js
+++ b/commands/Pokemon/claim.js
@@ -39,7 +39,8 @@ 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;
field = field.description;
@@ -52,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!');
@@ -61,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);
}
};