How can I get the userId if the message type is ActivityTypes.ConversationUpdate.
I want to show the user name in the beginning of the welcome message like Hi
I am passing the userid and username from the MVC application. I got the userid if the message type is ActivityTypes.Message
I could not find the userid if the message type is ActivityTypes.ConversationUpdate.
Once the message type changed to ActivityTypes.Message then the actual userId is available or the user input the value to chat.
How can I get the userId if the message type is ActivityTypes.ConversationUpdate.
Activity.MembersAdded might be what you need:
https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Microsoft.Bot.Connector.Shared/ConnectorAPI/Models/Activity.cs#L128
Thanks for your quick information.
This is not the correct answer.
I am passing the userId and user name to the below query string.
https://webchat.botframework.com/embed/
if the message type is ActivityTypes.ConversationUpdate, this case I am getting the userid from From.Id or Activity.MembersAdded[0].id but that is not the correct userId and expecting the actual userid from wechat url.
if the message type is ActivityTypes.Message, this case I am getting the correct userid which I have passed from wechat url.
The requirement is once the user logged into the Webchat application I have to display the user name with welcome message in the Chatwindow . storing the userid and token information to BotState from the web application. If I get the userId from Activity I can pulling the token information from botstate. I have a problem only with ActivityTypes.ConversationUpdate that have some id but not the actual userid.
Same issue here. I even raised an issue few days earlier but didn't get a satisfying answer. https://github.com/Microsoft/BotBuilder/issues/1994
please help me to get the right answer.
I am working on proactive Bot application and send the notification to webchat. The user signed into webpage that page has webchat, How the user will get the notification without input any message to webchat. Here I am looking the solution to get the ResumptionCookie data from ActivityTypes.ConversationUpdate.
Is there any solution to send the notification message to webchat without user input to webchat?
@danmarshall @eanders-MS do you know?
I don't know, Can I contact this person over Email?
@JeevaJose I am closing this issue for inactivity, please continue the conversation here if needed. We can reopen the issue if it is still not resolved.
Still active in case of webchat client.
Hello all, remember that ActivityTypes.ConversationUpdate is going to be called twice - once for the bot user and once for the user. See https://github.com/Microsoft/BotBuilder/issues/1930
Also, the userid URL parameter is not officially supported, it will not be passed to DirectLine and it will not be the same id in the activities.
In the case of WebChat it is called only once. And only for Bot side! And it is the issue! Please take a look.
Hello @andrejs-mamontovs can you please let us know your SDK and provide a code sample?
Hi Now it is Microsoft.Bot.Bulder 3.9.0.0 (C#) (valid for older versions as well) on the backend. Just run WebClient from https://dev.botframework.com/bots portal, test section. Demo code is as simple as possible, just handle ConversationUpdate (MVC controller code) and prepare response. In my case, only one greeting was returned (Works fine in the official emulator).
@andrejs-mamontovs can you try this sample: https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/core-GetConversationMembers
I deployed the C# sample from the link above and verified that I get 2 updates, one for the bot, and one for the end user:

So, so far no luck. I tried your code as part of my project with no luck. will try to find the reason later.
Were you able to implement this?
Same issue with me. Are you guys able to solve this ?
Hi @aqanonas
This is a known issue with a workaround described here: https://blog.botframework.com/2018/07/12/how-to-properly-send-a-greeting-message-and-common-issues-from-customers/
There is also a related issue on the WebChat repository: https://github.com/Microsoft/BotFramework-WebChat/issues/1371