Skip to content

Instantly share code, notes, and snippets.

@captDaylight
Last active May 22, 2016 21:03
Show Gist options
  • Save captDaylight/283ed8ebb58e5962d267bd6af203e334 to your computer and use it in GitHub Desktop.
Save captDaylight/283ed8ebb58e5962d267bd6af203e334 to your computer and use it in GitHub Desktop.
if (convo.status === 'completed') {
const prc = convo.extractResponse('rockPaperScissors');
channels.get(channel, (err, data) => {
if (err) throw err;
const updateData = data;
updateData.players[user].played = prc;
const { players } = updateData;
const playerIDs = Object.keys(players);
// check if only one player has played
const onlyOnePlayed = playerIDs.find((id) => players[id].played === '');
});
} else {
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment