使用DirectLine和网络聊天(Node.js)在bot-framework v4中发送打字指示符 [英] Send a typing indicator in bot-framework v4 using DirectLine and webchat (Node.js)

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

问题描述

Microsoft bot框架的官方文档 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中发送打字指示符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆