2

I am working on a chatbot with Watson Conversation (for the a.i.) and Node.js as a backend but I am having trouble sending messages in the right sequence.

I found some people with the same prob. on Facebook Messenger bot not sending messages in order and on https://developers.facebook.com/bugs/565416400306038 but i don't know if this issue is resolved or not ..

I've tried queuing promises and recursion, but i am still getting random sequencing. Any suggestions ??

Pierre Clier
  • 21
  • 1
  • 2

1 Answers1

0

It would be useful to see how your app.js is set up with the send message API.

I had a similar issue for which I created a function called SendCascade

/**
   * sendCascadeTo() allows developers to send a cascade of messages
   * in a sequence. All types of messages can be sent (including raw messages).
   *
   * @param {Array} messageArray of messages in a format as such: [{text: 'something'}, {message: someMessengerValidMessage}]
   * @param {string} recipientId just the id of the recipient to send the messages to. If using full messages, the id will not be used
   *
   * @return {Promise} promise
   * The returned value an in-place array of bodies received from the client platform
   * The objects of the array are of the same format as for standard messages
   *
   */

An example of a FB bot kit that supports Watson conversation and includes some FB actions can be found here Botmaster

ReeceMed
  • 93
  • 7