0

When bot was fetching the data from web services, that time i need to say bot is typing to the users.

2 Answers2

2

Generally the Typing Indicator is implemented inside a Middleware Function (Documentation here) in Bot Builder SDK.

A middleware basically intercepts all messages that are exchanged between user and bot. For each message that is intercepted, you may choose to do various functionalities. Rather than implementing in a root dialogue ( or you can say bot.dialog("/") ), the Best Practice says to implement inside a middleware.

Code Snippet:

i. bot.use(builder.Middleware.sendTyping());

Or:

ii.

 bot.use({
    botbuilder: function (session, next) {
        session.send();
        session.sendTyping();
        next();
    }
});

Try either of solution i. or ii. Both has the same functionality.

poet_
  • 632
  • 6
  • 14
1

Welcome to StackOverflow.

Bot Framework's NodeJS SDK has a method to send typing indication to the channels. Don't know what SFB stands for though (I guess its Skype for Business).

bot.dialog("/", function(session){
  session.sendTyping();
});

You can check channel inspector to find out which channels support this feature.

Master Chief
  • 2,520
  • 19
  • 28