diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-25 21:58:31 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-25 21:58:31 -0500 |
| commit | 2b83e842fea1c9cab7abbe45154a1f140e26f990 (patch) | |
| tree | d5632015dbc0f28a56ee1295d0d32d92378b6204 /commands/Pokemon/tradegym.js | |
| parent | 6d17517b4543afbf5100b55619efc8a6d8f3c754 (diff) | |
| download | PokeBot-2b83e842fea1c9cab7abbe45154a1f140e26f990.tar.gz PokeBot-2b83e842fea1c9cab7abbe45154a1f140e26f990.tar.bz2 PokeBot-2b83e842fea1c9cab7abbe45154a1f140e26f990.zip | |
Basic music commands
Diffstat (limited to 'commands/Pokemon/tradegym.js')
| -rw-r--r-- | commands/Pokemon/tradegym.js | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/commands/Pokemon/tradegym.js b/commands/Pokemon/tradegym.js index 17ca6f4..f10e3fa 100644 --- a/commands/Pokemon/tradegym.js +++ b/commands/Pokemon/tradegym.js @@ -1,4 +1,4 @@ -/**************************************** +/** ************************************** * * TradeGym: Plugin for PokeBot that powers the PokeWorld gym system. * Copyright (C) 2018 TheEdge, jtsshieh, Alee @@ -18,37 +18,36 @@ * * *************************************/ -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'; - if (msg.member.roles.find('name', 'Rocket')) team = 'Rocket'; - 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 ' + recipient); - let 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.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', - }; -
\ No newline at end of file +exports.run = async (bot, msg) => { + + 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'; + if (msg.member.roles.find('name', 'Rocket')) team = 'Rocket'; + 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 ' + recipient); + let 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.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', +}; |
