加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

机器人 – Microsoft Bot Framework – 如何更改演示文稿消息

发布时间:2020-12-14 05:31:48 所属栏目:Windows 来源:网络整理
导读:我正在开发一个基于Microsoft BotFramework的项目. 我想改变Bot描述消息,如: 嗨!我是xxxx.如果你想聊天,请说“嗨” 至少能够本地化描述也是一个很好的结果. 谢谢, 塞巴斯 解决方法 在块中添加消息(message.Type == ActivityTypes.ConversationUpdate) priv
我正在开发一个基于Microsoft BotFramework的项目.
我想改变Bot描述消息,如:

嗨!我是xxxx.如果你想聊天,请说“嗨”

至少能够本地化描述也是一个很好的结果.

谢谢,

塞巴斯

解决方法

在块中添加消息(message.Type == ActivityTypes.ConversationUpdate)

private Activity HandleSystemMessage(Activity message)
    {
        if (message.Type == ActivityTypes.DeleteUserData)
        {
            // Implement user deletion here
            // If we handle user deletion,return a real message
        }
        else if (message.Type == ActivityTypes.ConversationUpdate)
        {
            // Not available in all channels
            string replyMessage = "Hi,<Custom Message>";
            return message.CreateReply(replyMessage);
        }
        else if (message.Type == ActivityTypes.ContactRelationUpdate)
        {
            // Handle add/remove from contact lists
            // Activity.From + Activity.Action represent what happened
        }
        else if (message.Type == ActivityTypes.Typing)
        {
            // Handle knowing that the user is typing
        }
        else if (message.Type == ActivityTypes.Ping)
        {
        }

        return null;
    }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读