How to get user name at bot application
I am using DirectLine api to connect my bot application. In my implementation, I have used below code block to send messages. My idea to use from property in the my bot application and for any kind of verification or communication. But in my bot application I am not able to get this property. So please help me with code snippet which can solve my problem.
Message message = new Message { FromProperty = User.Identity.Name, Text = paramMessage };
Hi @srinutamada, it looks like you're using the Direct Line 1.1 API. This API does not support usernames. Direct Line 3.0 does -- you can find the Beta Nuget library here: https://www.nuget.org/packages/Microsoft.Bot.Connector.DirectLine/3.0.0-beta
You will have to enable "3.0 [PREVIEW]" on your bot's Direct Line configuration page. Otherwise the API is fairly similar.
Thanks for your information.
Do you have any working code to send a message with user name to bot application. It seems most of the methods and implementation got change compare to 1.1 version.
Hi @srinutamada, this sample helps show how to send messages with Direct Line 3.0: https://github.com/Microsoft/BotBuilder-Samples/blob/master/CSharp/core-DirectLine/DirectLineClient/Program.cs
You can find the user's ID and name in the Activity message sent to your bot, within the activity.From field.
Closing as it looks like the question has been answered. Please open a new issue if you'd like to discuss further.