microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

How can I add or update a key of JSON payload from the bot to user in Microsoft Bot Framework? #6521

Closed shamim237 closed 2 years ago

shamim237 commented 2 years ago

Usually, the bot sends an activity to the user as a JSON payload. Here is the payload-

{
  "type": "message",
  "serviceUrl": "http://localhost:9544",
  "channelId": "emulator",
  "from": {
    "id": "ddee8ae0-fbab-11ec-91b0-b11a643e6ffb",
    "name": "Bot",
    "role": "bot"
  },
  "conversation": {
    "id": "b26b71f0-fbae-11ec-91b0-b11a643e6ffb|livechat"
  },
  "recipient": {
    "id": "3e0941a8-8f60-4aa5-9c93-d9edda1ac2b5",
    "role": "user"
  },
  "locale": "en-US",
  "text": "Please enter your name.",
  "inputHint": "acceptingInput",
  "replyToId": "d3f73e80-fbae-11ec-bafd-418122b4a0f7",
  "id": "d3fd5900-fbae-11ec-bafd-418122b4a0f7",
  "localTimestamp": "2022-07-04T21:34:44+06:00",
  "timestamp": "2022-07-04T15:34:44.112Z"
}

I want to add a key like in the above payload

  "from": {
    "id": "ddee8ae0-fbab-11ec-91b0-b11a643e6ffb",
    "name": "Bot",
    "role": "bot"

Suppose that I want to add a custom key like-

"user": {

       "email": "abc@gmail.com"
       "pass" : "1234"
}

How can I do this? Is it possible to do? Or Can I update any value of a key?

Please add some code snippets in Python if it is possible to do.

shamim237 commented 2 years ago

@ramfattah can you give me something on that?

ramfattah commented 2 years ago

Hi @shamim237,

The Microsoft Bot Framework team prefers that how to questions be submitted on Stack Overflow.  The official Bot Framework Github repositories are the preferred platform for submitting bug fixes and feature requests.

ramfattah commented 2 years ago

Closing this issue as duplicate how-to question is open in StackOverflow https://stackoverflow.com/questions/72859476/how-can-i-add-or-update-a-key-of-json-payload-from-the-bot-to-user-in-microsoft

shamim237 commented 2 years ago

@ramfattah But you haven't give any solution!!!