本文介绍了使用DirectLine和网络聊天(Node.js)在bot-framework v4中发送打字指示符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft bot框架的官方文档 SDK v4 不演示如何发送打字指示符(而 v3具有这些说明).我正在使用DirectLine和botframework-webchat.

The official docs for Microsoft bot-framework SDK v4 do not demonstrate how to send a typing indicator (whereas v3 has these instructions). I'm using DirectLine and botframework-webchat.

我该怎么做?谢谢!

推荐答案

您可以通过发送类型为typing的活动来发送键入指示符.进一步了解如何发送打字指示符.

You can send a typing indicator by sending an activity with the typing type. Read more about how to send a typing indicator.

await context.sendActivities([
            { type: ActivityTypes.Typing },
            { type: 'delay', value: 3000 },
            { type: ActivityTypes.Message, text: 'Finished typing' }
        ]);

showTypingMiddleware 可用于自动发送打字指示符.如果您需要更多示例代码,此代码段还将显示如何发送打字指示符.

Also the showTypingMiddleware can be used to automatically send the typing indicator. This snippet will also show how to send a typing indicator, if you are looking for more sample code.

这篇关于使用DirectLine和网络聊天(Node.js)在bot-framework v4中发送打字指示符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 13:23