Last active
May 15, 2016 00:19
-
-
Save captDaylight/ee4008f8df96930693321ebf81330a5c 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
hears(['play'], 'direct_message,direct_mention,mention', (bot, message) => { | |
const { user, channel, text } = message; // destructure message variable | |
const userData = text.match(/<@([A-Z0–9]{9})>/); // parse the text for user's 9 character id | |
if (userData) { | |
// if there is a user challenged, start the game | |
} else { | |
bot.reply(message, 'You didn\'t challenge anyone…'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment