0

I have created a bot with Botpress and connected it to MS Teams via Azure. I would now like to send an adaptive card in Teams. I found out that you can send an adaptive card in teams like this: https://github.com/botpress/solutions/blob/master/custom%20solutions/Send%20adaptive%20cards%20using%20teams/actions/sendAdaptativeCard.js. My problem now is that I don't get any user inputs back, only objects which Botpress can't read. I have also already opened a discussion in the Botpress forum. See here: https://github.com/botpress/botpress/discussions/12600 Unfortunately, I'm getting nowhere on my own and can't get an answer. Does anyone here have an idea how I can read the user inputs from an Adaptive card in Botpress? I am new to chatbots and the Microsoft documentation is very detailed but also very confusing. I would be very grateful for any help.

Best regards Eva

Dana V
  • 935
  • 4
  • 10

1 Answers1

1

I tired the code below using adaptive cards in MS Teams bot.

Sample Javascript code:-

const  card = {
"$schema":  "http://adaptivecards.io/schemas/adaptive-card.json",
"version":  "1.4",
"type":  "AdaptiveCard",
"body": [
{
"type":  "TextBlock",
"text":  "Hello, world!",
"size":  "large"
}
]
};
const  message = {
type:  "message",
text:  "Here's an adaptive card:",
attachments: [CardFactory.adaptiveCard(card)]
};
await  context.sendActivity(message);
break;

  • The other way to implement adaptive cards is creating a Json file .

enter image description here

enter image description here

Output:

enter image description here

Reference :

Sampath
  • 810
  • 2
  • 2
  • 13
  • thanks @Sampath for your help. i tried this, but since i work with botpress it doesn't work that way unfortunately. – Eva Stohrer May 09 '23 at 14:42