Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass custom debug information to Microsoft bot framework emulator

I am developing a bot based on a .NET Bot Builder SDK.

Is it possible for a bot to pass some debug information together with the message, so I can see it in the Details section of the Bot Framework Chanel Emulator when the message is clicked?

like image 875
Andriy Kozachuk Avatar asked Jun 30 '26 13:06

Andriy Kozachuk


1 Answers

Great Question. Yes, it is entirely possible. You can use the ChannelData property of your activity you are responding with. The data entered into the ChannelData property must be valid JSON For example:

var reply = activity.CreateReply("test");
string json = @"{
    CustomField1: 'Field one value',
    CustomField2Array: [
        'First Element',
        'Second Element'
        ]
    }";


reply.ChannelData = JObject.Parse(json);
await context.PostAsync(reply);

In the emulator this will appear as:

"channelData": {
    "CustomField1": "Field one value",
    "CustomField2Array": [
      "First Element",
      "Second Element"
    ]
  }
like image 110
D4RKCIDE Avatar answered Jul 02 '26 01:07

D4RKCIDE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!