Chain multiple messages.
Closed this issue · 2 comments
brenohq commented
Hello! I'm trying to chain some messages. For example:
bot.sendTextMessage(userId, "Message 1...");
bot.sendTextMessage(userId, "Message 2...");
I need these messages to be sent in order. "Message 1..." and then "Message 2...".
I've tried this, but unsuccessful.
bot.sendTextMessage(userId, "Message 1...").then(() => {
bot.sendTextMessage(userId, "Message 2...");
})
Thanks for the nice job man, bye!
Deleted user commented
Hey brenohq,
you can use the cb function
function cb() {
bot.sendTextMessage(userId, "Message 2");
}
bot.sendTextMessage(userId, "Message 1", null, cb");
cheers,
franzus
brenohq commented
@franzus888 Tranks bro!