Skip to content

Instantly share code, notes, and snippets.

@devStepsize
Last active April 22, 2016 20:04
Show Gist options
  • Save devStepsize/1f43a5bd467b951cfd8960852297d053 to your computer and use it in GitHub Desktop.
Save devStepsize/1f43a5bd467b951cfd8960852297d053 to your computer and use it in GitHub Desktop.
Botkit conversation with ask and a single callback
// From https://github.com/howdyai/botkit#using-conversationask-with-a-callback
controller.hears(['question me'], 'message_received', function(bot,message) {
// start a conversation to handle this response.
bot.startConversation(message,function(err,convo) {
convo.ask('How are you?',function(response,convo) {
convo.say('Cool, you said: ' + response.text);
convo.next();
});
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment