Bot not sending welcome message RRS feed

  • Question

  • Hello,

    I have created a QnA maker kb and created a bot using Azure web app bot. It is working completely fine when I test it in "Test in Web Chat". But when I add that code in the web page, the welcome message does not appear first. It comes when the user enters some text.

    can someone help how to get welcome message first in Bot?


    Wednesday, May 13, 2020 11:33 AM

All replies

  • Hello Narendra,

    We have a very detailed set of steps to send a welcome message when there are any of the two events that occur.

    • OnMembersAddedAsync which is called whenever a new user is connected to your bot
    • OnMessageActivityAsync which is called whenever a new user input is received

    In your case it looks like there is no implementation of the first method that could detect a new user that is connected to the bot and send a welcome message. The documentation here details the steps to add this to your bot WelcomBotUser.cs which should fix your issue. 

    A simple sample is also available on github if you would want to try it before implementing in your existing bot.

    If you found this post helpful, please give it a "Helpful" vote. 
    Please remember to mark the replies as answers if they help. 

    Thursday, May 14, 2020 1:29 PM
  • Hi Rohit,

    i have OnMembersAddedAsync implementation to the project.

    Welcome message in coming perfectly when i test in Emulator or in Web Chat. But when i use the Bot in any other application through iFrame, Welcome Message is not coming unless i post any question.

    attaching image what i am seeing through iFrame.

    Friday, May 15, 2020 6:31 AM