botkit-messenger-express-demo
botkit-messenger-express-demo copied to clipboard
Cannot send message
Trying to use this demo in my existing project with the latest Botkit. My 'facebook_optin' is working fine. But when I send any other message from facebook I get the following error:
TypeError: Cannot set property 'stage' of undefined at Object.Botkit.botkit.receiveMessage (... CoreBot.js:108:33)
Line 108 in CoreBot.js looks like the following:
botkit.receiveMessage = function(bot, message) {
message._pipeline.stage = 'receive'; // <------------------- this is line 108
botkit.middleware.receive.run(bot, message, function(err, bot, message) {
if (err) {
Same issue here when updating from ^0.5.2 → ^0.6.4 and using interactive buttons.
@davidvexel I solved this by using controller.ingest(bot, facebook_message);
instead of controller.receiveMessage(bot, message);
Remember to use facebook_message and not facebook_message.message. Hope it works for you too.
thanks @deathg0d, I'm using it on Slack, wondering if it's the same work around.
Hey folks,
Just to let you know that
- I'm not actively maintaining that repo anymore
- Since Botkit, Slack API, FB API evolve very quickly, there is a high probability of obsolescence of some parts of the code.
=> If you find a solution to your issue, please consider a PR! I'll happily merge it. This repo is aimed at helping beginners, so let's make it better