diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-24 21:22:16 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-24 21:22:16 -0500 |
| commit | 773ebdeccaef172ccfb46cf5d5bb070cee93eabe (patch) | |
| tree | 6c81dd5d765f321a0dbd29f4290fbae7ec8c56cb | |
| parent | b3d0b3c933e140a011739c1ba23852258de9e392 (diff) | |
| download | PokeBot-773ebdeccaef172ccfb46cf5d5bb070cee93eabe.tar.gz PokeBot-773ebdeccaef172ccfb46cf5d5bb070cee93eabe.tar.bz2 PokeBot-773ebdeccaef172ccfb46cf5d5bb070cee93eabe.zip | |
try
| -rw-r--r-- | commands/Pokemon/claim.js | 21 | ||||
| -rw-r--r-- | commands/Pokemon/join.js (renamed from commands/Teams/join.js) | 0 | ||||
| -rw-r--r-- | commands/Pokemon/leave.js (renamed from commands/Teams/leave.js) | 0 |
3 files changed, 21 insertions, 0 deletions
diff --git a/commands/Pokemon/claim.js b/commands/Pokemon/claim.js new file mode 100644 index 0000000..dccbd29 --- /dev/null +++ b/commands/Pokemon/claim.js @@ -0,0 +1,21 @@ +exports.run = async (bot, msg) => { + if (!msg.channel.topic.startsWith('Current Owner:')) return msg.reply('Go into one of the gym channels and try again.'); + if (msg.channel.topic == 'Current Owner: *none*') { + msg.reply('Alright, you have claimed this gym as yours! Be ready to battle anyone who approaches you'); + msg.channel.setTopic('Current Owner: ' + msg.author.id + '/' + msg.author.tag); + } + else { + const owner = msg.channel.topic.slice(15).substring(msg.author.id.length); + msg.channel.send('<@' + owner + '>, come here as ' + msg.author + 'wants to battle you.'); + } +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'claim', + description: 'Claim a gym.', +}; diff --git a/commands/Teams/join.js b/commands/Pokemon/join.js index 39bdf90..39bdf90 100644 --- a/commands/Teams/join.js +++ b/commands/Pokemon/join.js diff --git a/commands/Teams/leave.js b/commands/Pokemon/leave.js index fb02e16..fb02e16 100644 --- a/commands/Teams/leave.js +++ b/commands/Pokemon/leave.js |
