Last active
May 15, 2016 01:43
-
-
Save captDaylight/c026c51154d4f6f0020abccecf2ff005 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
if (data && 'players' in data) { | |
const { user } = message; | |
const { players } = data; | |
if (user in players && !players[user].accepted) { | |
// player two accepted | |
bot.reply(message, 'GREAT, LET THE BATTLE BEGIN!!!'); | |
} else { | |
const player = Object.keys(players).find((p) => !players[p].accepted); | |
bot.reply(message, `Not you <@${user}>, waiting for <@${player}>.`); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment