aboutsummaryrefslogtreecommitdiff
path: root/commands/Pokemon/tradegym.js
diff options
context:
space:
mode:
authorpokesudenk <thisis@notarealema.il>2018-02-25 13:12:48 -0500
committerpokesudenk <thisis@notarealema.il>2018-02-25 13:12:48 -0500
commitea674831bf2139fa295f6c9d532036354bb36f1e (patch)
tree2048c8f0424ba4766add3eaa4389a287ff9cda9a /commands/Pokemon/tradegym.js
parentc2ed17bc46fa025f15b7fc4007ec3546c7823b4b (diff)
downloadPokeBot-ea674831bf2139fa295f6c9d532036354bb36f1e.tar.gz
PokeBot-ea674831bf2139fa295f6c9d532036354bb36f1e.tar.bz2
PokeBot-ea674831bf2139fa295f6c9d532036354bb36f1e.zip
trying to fix tradegym plugin
Diffstat (limited to 'commands/Pokemon/tradegym.js')
-rw-r--r--commands/Pokemon/tradegym.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/commands/Pokemon/tradegym.js b/commands/Pokemon/tradegym.js
index b3ccb0c..7ce3664 100644
--- a/commands/Pokemon/tradegym.js
+++ b/commands/Pokemon/tradegym.js
@@ -19,6 +19,7 @@
* *************************************/
exports.run = async (bot, msg, args) => {
+
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', 'Aqua')) team = 'Aqua';
@@ -26,14 +27,14 @@ exports.run = async (bot, msg, args) => {
if (msg.member.roles.find('name', 'Magma')) team = 'Magma';
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 '+ msg.mentions.members.first());
+ msg.reply('Trading gym to ' + recipient);
let recipientTeam;
- if (msg.mentions.members.first.roles.find('name', 'Aqua')) recipientTeam = 'Aqua';
- if (msg.mentions.members.first.roles.find('name', 'Rocket')) recipientTeam = 'Rocket';
- if (msg.mentions.members.first().roles.find('name', 'Magma')) recipientTeam = 'Magma';
- msg.channel.setTopic('Current Owner: ' + msg.mentions.members.first().id + '/' + msg.mentions.members.first().tag + '/' + recipientTeam);
+ if (recipient.roles.find('name', 'Aqua')) recipientTeam = 'Aqua';
+ if (recipient.roles.find('name', 'Rocket')) recipientTeam = 'Rocket';
+ if (recipient.roles.find('name', 'Magma')) recipientTeam = 'Magma';
+ msg.channel.setTopic('Current Owner: ' + recipient.id + '/' + recipient.tag + '/' + recipientTeam);
}
else {
msg.reply('You have to own the gym to be able to trade it!');