botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Microsoft.Bot.Connector.DirectLine.Models.Message FromProperty

Open rodzillarr opened this issue 10 years ago • 2 comments

In C#, the Message.FromProperty expects a string. What is the expected format of the object to be placed into this property to identify who this message is from? In the Bot Framework the From property on the message object is a ChannelAccount.

rodzillarr avatar May 17 '16 19:05 rodzillarr

I've tried putting in the JSON serialized ChannelAccount object from the orginal message's From property. I've also just tried putting in the id from that object.

rodzillarr avatar May 17 '16 20:05 rodzillarr

This is the user's ID. If you have an ID for the user (for instance, you have embedded a chat control in a mobile app and can send the device ID) you can use that. Otherwise, you can allocate an ID on your own and use that. I've seen folks use v4 UUIDs and cryptographically random IDs.

The Bot Connector service converts this ID to/from a ChannelAccount field. As long as the field is stable, you'll always get the same ChannelAccount record on the bot side.

dandriscoll avatar May 18 '16 00:05 dandriscoll