Closed unigazer closed 2 years ago
Looks like BootBot.js
has a handler that assumes entry.messaging
exists:
handleFacebookData(data) {
// Iterate over each entry. There may be multiple if batched.
data.entry.forEach((entry) => {
// Iterate over each messaging event
:( ===> entry.messaging.forEach((event) => {
...
});
});
}
Capturing the input, I get an object which has no messaging
property:
[ { id: '146158229413601',
time: 1520018748761,
standby: [ [Object] ] } ]
I think this problem occurs because you're subscribed to events that the bot isn't equipped to handle by default. It just assumes everything will be one kind of event. Adding if (!entry.messaging) return;
at the top of that forEach
seems to fix things. Not sure what side effect it has though.
@VladimirDev93 @secretrobotron This seems to be the same issue that's described in https://github.com/Charca/bootbot/issues/86 . The workaround to stop receiving the error is mentioned in that issue as well.
🎉
Tried this example: https://github.com/Charca/bootbot/blob/master/examples/persistent-menu-example.js
but getting this on logs (Heroku):
My index.js
When it comes to
I even tried using "Postman" to send a POST request with same JSON data (https://developers.facebook.com/docs/messenger-platform/send-messages/persistent-menu), but still getting
UPDATE Ok, after couple of seconds the "Persistent menu" works, but Heroku still logs the same error. Can you check that out, if you have time?