Open rrsilaya opened 4 years ago
Hi. I have code like this:
chat.conversation((convo) => { function handlePaginatedMessage(convo) { // ... const chunk = 'long message'; const dialog = { text: chunk, buttons: [{ type: 'postback', title: 'Read More', payload: 'READ_MORE', }] }; const callbacks = [{ event: 'postback:READ_MORE', callback: () => { // code here }, }]; convo.ask(dialog, () => {}, callbacks); } handlePaginatedMessage(convo); });
I also have a listener to postback events i.e.:
postback
bot.on('postback', callback);
However, after the bot asks the user, the context gets lost and the postback goes with the global postback listener instead of the conversation callbacks.
Am I doing something wrong?
Hi. I have code like this:
I also have a listener to
postback
events i.e.:However, after the bot asks the user, the context gets lost and the postback goes with the global postback listener instead of the conversation callbacks.
Am I doing something wrong?