小编Ami*_*t C的帖子

在 v4 Bot Framework Bot(C# + .Net Core Web 应用程序)中显示欢迎消息

我用 v3 (C#) SDK 创建了一个机器人,并且欢迎信息过去工作得很好,没有任何汗水。它在生产中仍然对我有用。代码在 HandleSystemMessage 中像这样处理 -

.. 为清楚起见,删除了 v3 代码附加代码...

else if (message.Type == ActivityTypes.ConversationUpdate)
{
// Handle conversation state changes, like members being added and removed
// Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
// Not available in all channels

//Code to show Welcome Message
if (message.MembersAdded.Any(o => o.Id == message.Recipient.Id))
{
var reply = message.CreateReply();
reply.Attachments = new List<Attachment>();
// Create the attachment.
Attachment attachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = AdaptiveCardHelper.GetOptionsCard() …
Run Code Online (Sandbox Code Playgroud)

c# botframework

2
推荐指数
1
解决办法
4236
查看次数

标签 统计

botframework ×1

c# ×1