0
votes

I want to make one bot by joining multiple channels like Facebook messenger , Alexa,Native app , Web chat to have a seamless and friction less experience.

User should be able to open and initiate a chat session in-app and close it but not lose the session So that I can easily instigate a chat session with a bot or agent from within the app.

For an instance If I am a user chatting on Facebook messenger bot and after sometime i close it and open the chat bot on the webpage So I should be able to resume the same chat on that channel means session of the user's chat should not be lost.

1
You will have to record the sessions on your backend and combine the account-linking for all integrations, definitely possible with a couple of coding nights. - Christophe Willemsen
Hi, any update yet? Looking forward for your news. - Gary Liu

1 Answers

0
votes

First of all, bot application connects to mulitiple channels and each channel has its distinct users from others. So as @christophe-willemsen said, you need to build up your own account system and link to all the channels your bot connect. With which, you need to pair the session data with the user.

Then, you can leverage Manage state data to store and access user data. And leverage Advance the waterfall to manage the waterfall steps inside the dialogs.

For quick reference:

let savedSession;
var bot = new builder.UniversalBot(connector, [(session) => {
    if (savedSession) {
        var [savedDialog] = savedSession.dialogStack().slice(-2, -1);
        console.log(savedDialog);
        session.replaceDialog(savedDialog.id, savedDialog.state)
    } else {
        savedSession = session;
        session.beginDialog('form');
    }
}]);

bot.dialog('form', [...waterfall steps...])