Skip to content

Instantly share code, notes, and snippets.

@captDaylight
Last active May 15, 2016 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save captDaylight/70af775ce16a986385a139fa9ba2d32b to your computer and use it in GitHub Desktop.
Save captDaylight/70af775ce16a986385a139fa9ba2d32b to your computer and use it in GitHub Desktop.
// a bot can listen for text it's not mentioned in
// by passing 'ambient' as the second parameter
hears(['accept'], 'ambient', (bot, message) => {
const { channel } = message;
channels.get(channel, (err, data) => {
if (err) throw err;
if (data && 'players' in data) {
// game has started !
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment