The problem is that convo.addQuestion and convo.ask don't block and wait for a response.
I am not sure whether this is limited only to Facebook or these two function but that is what I have ran into.
Using the example Facebook bot to keep things simple.
var Botkit = require('botkit');
var controller = Botkit.facebookbot({
access_token: process.env.access_token,
verify_token: process.env.verify_token,
debug: true,
})
controller.startTicking();
var bot = controller.spawn({
});
controller.setupWebserver(3000,function(err,webserver) {
controller.createWebhookEndpoints(controller.webserver, bot, function() {
console.log('This bot is online!!!');
});
});
controller.hears(['talk'],
'message_received',
(bot, message) => {
bot.startConversation(message, (err, convo) => {
convo.addQuestion('Say oi', [
{
pattern: 'oi',
callback: (res, con) => {
con.gotoThread('you done');
con.next();
}
}, {
default: true,
callback: (res, con) => con.next()
}
]);
convo.ask('pi', (res, con) => con.next());
convo.addQuestion('Are you done?', [
{
pattern: bot.utterances.yes,
callback: (res, con) => {
con.gotoThread('default');
con.next();
}
}, {
default: true,
callback: (res, con) => {
con.repeat();
con.next();
}
}
],
{},
'you done');
convo.addMessage('DONE!');
});
});
And here's the kind of output I get

What in addQuestion says to block and wait for a response? I can鈥檛 see anything here https://github.com/howdyai/botkit/blob/master/lib/CoreBot.js#L331
To me it looks like messages just get pushed to the messages queue
I have the same issue, it didn't wait for response

To produce
1- clone Facebook starter project
2- install packages (botkit v0.6.7)
3- deploy
4- send the text 'color' to the bot
It should wait till you write any text but it didn't and replied
tested on botkit v0.6.7 & v0.6.6
@MMayla This is caused by the new Facebook events that Botkit isn't up to date with.
The solution is to subscribe to the below events:

Most helpful comment
@MMayla This is caused by the new Facebook events that Botkit isn't up to date with.
The solution is to subscribe to the below events: