0

Is there any way i can ask my bot a question and make it wait for a response to that particular question so i could do some more things on that particular message?

Fadil Olamyy Wahab
  • 626
  • 2
  • 6
  • 15

1 Answers1

2

Yes, there are examples in the botkit readme. copy pasting :

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();
    });
  })
})
Matthieu
  • 1,149
  • 7
  • 11