C#中Bot框架的输入指示器 [英] Typing indicator for bot framework in C#
本文介绍了C#中Bot框架的输入指示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Bot框架中拥有一个机器人.一旦用户对漫游器做出响应并且漫游器正在对其进行处理,我想同时向用户显示打字指示符.
I have a bot in Bot framework. Once user responds to the bot and bot is processing it, I want to show the typing indicator to the user in the meanwhile.
It is possible in Nodejs here - https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-send-typing-indicator
但是如何在C#中实现它呢?
But how can I implement it in C#?
推荐答案
您必须发送Typing
类型的活动.
You have to send an activity of type Typing
.
您可以这样做:
// Send "typing" information
Activity reply = activity.CreateReply();
reply.Type = ActivityTypes.Typing;
reply.Text = null;
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
await connector.Conversations.ReplyToActivityAsync(reply);
这篇关于C#中Bot框架的输入指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文