Multiple bubbles from Watson Conversation
Closed this issue · 1 comments
cyrillebenoit commented
Hi,
When Watson should answer multiple text bubbles, only the first is displayed, but the route still progress.
Is it a bug or something ?
Thank you for your answer
cyrillebenoit commented
Fixed it :
botmaster.on('update', (bot, update) => { const context = inMemoryContexts[update.sender.id]; // this will be undefined on the first run const messageForWatson = { context, workspace_id: process.env.WORKSPACE_ID, input: { text: update.message.text, }, }; watsonConversation.message(messageForWatson, (err, watsonUpdate) => { inMemoryContexts[update.sender.id] = watsonUpdate.context; for(var i = 0; i< watsonUpdate.output.text.length ; i++) { const text = watsonUpdate.output.text[i]; bot.sendTextMessageTo(text, update.sender.id); } }) });