When user sends message to my bot, he receives Welcome message. But when user respond to that, bot sends Welcome message again. How can I fix this?

前端 未结 2 933
[愿得一人]
[愿得一人] 2020-11-29 12:01

I am developing a chatbot using Microsoft Bot Framework and i recently upgraded the framework 3.0 to 3.5. before upgrading it was working fine but now

When user sen

相关标签:
2条回答
  • 2020-11-29 12:22

    I believe this could be related to a change that was rolled out a few days ago; where Direct Line will send more ConversationUpdate messages than it used to.

    Check the announcement and a related issue (similar to yours, but in node.js).

    The first ConversationUpdate is sent when the bot is added to the conversation. After that, each additional ConversationUpdate is sent when a new user joins the conversation.

    So, I think the solution here will be to check the members added (activity.MembersAdded)

        else if (message.Type == ActivityTypes.ConversationUpdate)
        {
            if (message.MembersAdded.Any(o => o.Id == message.Recipient.Id))
            {
                // logic
            }
        }
    
    0 讨论(0)
  • 2020-11-29 12:31

    You need to handle that within the main dialog using switch operations based on intent and also adding dialogs for the relevant intent.

    There is a difference between introduction and greeting.

    0 讨论(0)
提交回复
热议问题