Botframework-sdk: Node.js indicate bot is typing?

Created on 17 Jul 2016  路  4Comments  路  Source: microsoft/botframework-sdk

With v3 I noticed that, at least in the C# version, there is a way to indicate the bot is "typing". I'm fairly certain its called a typing activity. I've gone through the node.js sdk and cant seem to find any kind of reference on something like this.

Is this functionality not yet in the Node.js SDK? If it is, how is it used?

Most helpful comment

I've already added a new session.sendTyping() method. Will be in next release :)

All 4 comments

In case anybody hits this thread who isn't on the Gitter channel, it is worth noting that @Stevenic has indicated that from node the typing activity can currently be sent using session.send({ type: 'typing' });. This may be replaced by a helper method at some stage.

I guess i'll close this for now. @Stevenic has indicated this functionality is not yet documented but will be soon. Thanks again.

I've already added a new session.sendTyping() method. Will be in next release :)

To add to stevenic s point, this is what the method looks like
Session.prototype.sendTyping = function () {
this.msgSent = true;
var m = { type: 'typing' };
this.prepareMessage(m);
this.batch.push(m);
logger.info(this, 'session.sendTyping()');
this.startBatch();
return this;
};

Notice the call to startBatch which has this line inside
this.batchTimer = setTimeout(function () {
_this.sendBatch();
}, this.options.autoBatchDelay);

So the sendTyping occurs after 250 ms if I am not mistaken , saw this somewhere in code this.options.autoBatchDelay = 250;

Was this page helpful?
0 / 5 - 0 ratings