botmaster-messenger
botmaster-messenger copied to clipboard
Error is thrown when bot is signed up for 'standby' webhook
When standby message is received, entry.messaging is undefined, throwing an 'not iterable' error on update, messenger_bot.js:146
Right. Wondering what should be the preferred behaviour here. I can either
- forward the messages in the same way as if they were sent in
messaging
, and you the developer would then check in theupdate.raw
if the update was sent as part of a standby if your code depends on that. Or, - I can simply ignore the messages, and not send them because the app in question is effectively in standby and it is not assumed that a response should come from it.
I am leaning towards the 1st solution, but not sure that would be what makes most sense to people
Hum, I think the first one sounds more plausible.
I just removed the standby webhook and it worked in my case, so handling in the first one should satisfy most needs
regards
From: John-David Wuarin [email protected] Sent: Monday, March 5, 2018 6:50 PM To: botmasterai/botmaster-messenger Cc: Marcelo Thomaz; Author Subject: Re: [botmasterai/botmaster-messenger] Error is thrown when bot is signed up for 'standby' webhook (#11)
Right. Wondering what should be the preferred behaviour here. I can either
- forward the messages in the same way as if they were sent in messaging, and you the developer would then check in the update.raw if the update was sent as part of a standby if your code depends on that. Or,
- I can simply ignore the messages, and not send them because the app in question is effectively in standby and it is not assumed that a response should come from it.
I am leaning towards the 1st solution, but not sure that would be what makes most sense to people
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/botmasterai/botmaster-messenger/issues/11#issuecomment-370579279, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANDEvHS0tZGi_ls2eAfMb1zE3BOIqwKfks5tbbMxgaJpZM4SdNhy.
@jdwuarin I'm having the same problem. My use case is that I am trying to handover my user messages to the human customer support, and in this case I am changing the active agent to Facebook Inbox, which is configured to be the secondary agent.
After doing that, every single message comes in updates.standby
, and I need to keep on listening to every message exchanged between them, so I can listen for an specific message to trigger the procedure to give the control back to my bot.
If you make it the second way, it won't be possible for do such thing with this lib.