1

I'm having an issue with Messenger dev platform and guessed I could ask you guys for some help.

I would like my bot to send multiple messages in a row, for exemple :

sendTextMessage(user, "Hello");
sendTextMessage(user, "Goodbye");

But since Node is asynchrone, the order is not always respected and sometimes 'Goodbye' ends up showing before 'Hello'.

What is the best solution to remedy this issue ?

Thanks for your help!

nsayer
  • 799
  • 2
  • 8
  • 21

1 Answers1

0

You can do this in NodeJS by using either callbacks or promises. If you are not familiar with either of them, you can read callbacks and promises.

For further more steps, please check this out:

https://stackoverflow.com/a/47497119/6874563

I used above and get solved.