Skip to content

Instantly share code, notes, and snippets.

@mbrevoort
Created August 2, 2016 15:36
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 mbrevoort/7a0d8612816a087f11c99398c308eee6 to your computer and use it in GitHub Desktop.
Save mbrevoort/7a0d8612816a087f11c99398c308eee6 to your computer and use it in GitHub Desktop.
// convo handlers are registered with unique strings
const handleGoodDay = 'handleGoodDay'
// handle any DM that starts with 'hi'
slapp.message('^hi', 'direct_message', (msg) => {
// Ask how they are and route next message to handleGoodDay handler
msg.say('Are you having a good day?').route(handleGoodDay)
})
// register handleGoodDay handler
slapp.route(handleGoodDay, (msg) => {
msg.say(':expressionless:')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment