How do i send custom data from WebChat to Bot in Node.js?

Zakaria Khorf 1 Reputation point
2022-05-16T23:26:03.51+00:00

i am trying to send some data from the WebChat to a BotFramework (Node.js)

Here is the WebChat code i am trying to use using the payload in the store :

In the Bot side, when i log the activity i don't find the payload i sent :

this.onMembersAdded(async (context, next) => {
      for (const idx in context.activity.membersAdded) {
        // Greet anyone that was not the target (recipient) of this message.
        // Since the bot is the recipient for events from the channel,
        // context.activity.membersAdded === context.activity.recipient.Id indicates the
        // bot was added to the conversation, and the opposite indicates this is a user.
        console.log(context.activity)
        if (context.activity.name === 'webchat/join') {
          console.log(context.activity.value)
          await context.sendActivity(`Got \`webchat/join\` event, your language is \`${ (context.activity.value || {}).email }\``);
        }

Any ideas why ? Thanks

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,558 questions
{count} votes