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

[Question] Cards not working in MS Teams?

Open meganlcooper opened this issue 9 years ago • 5 comments

I am using Hero Cards, Receipt Cards, and Adaptive cards in my bot. I am testing it out in ms teams right now and have the following issues:

  1. The buttons for my Hero Card are not working properly (pressing them enacts a Luis Intent). Here is the code for said hero card:
        public async Task showBotInformation(IDialogContext context, LuisResult result)
        {
            var helpMsg = context.MakeMessage();
            var helpHeroCard = new HeroCard
            {
                Title = "Hi, I'm Bridget.",
                Text = "I'm here to provide easy, information. ",
                Buttons = new List<CardAction> {
                    new CardAction(ActionTypes.PostBack , "Common Qs" , value: "show common questions"),
                    new CardAction(ActionTypes.PostBack , "Settings" , value: "settings")
                }
            };
            helpMsg.Attachments.Add(helpHeroCard.ToAttachment());
            await context.PostAsync(helpMsg);
        }```

2. Receipt cards aren't showing up at all? Are receipt cards not supported?

meganlcooper avatar Jun 08 '17 16:06 meganlcooper

@meganlcooper can you please share the code, we can review and debug the issue?

From: meganlcooper [mailto:[email protected]] Sent: Thursday, June 8, 2017 9:29 AM To: Microsoft/BotBuilder [email protected] Cc: Subscribed [email protected] Subject: [Microsoft/BotBuilder] Cards not working in MS Teams (#2906)

I am using Hero Cards, Receipt Cards, and Adaptive cards in my bot. I am testing it out in ms teams right now and have the following issues:

  1. The buttons for my Hero Card are not working properly (pressing them enacts a Luis Intent). Here is the code for said hero card: [LuisIntent("Help")] public async Task showBotInformation(IDialogContext context, LuisResult result) { var helpMsg = context.MakeMessage(); var helpHeroCard = new HeroCard { Title = "Hi, I'm Bridget.", Text = "I'm here to provide easy, information. ", Buttons = new List { new CardAction(ActionTypes.PostBack , "Common Qs" , value: "show common questions"), new CardAction(ActionTypes.PostBack , "Settings" , value: "settings") } }; helpMsg.Attachments.Add(helpHeroCard.ToAttachment()); await context.PostAsync(helpMsg); }
  2. Receipt cards aren't showing up at all? Are receipt cards not supported?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FBotBuilder%2Fissues%2F2906&data=02%7C01%7Cv-muarum%40microsoft.com%7C95e06ed597224ac9c19908d4ae8b89c0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636325361716344036&sdata=BvVXb6xioZZKQvaG6V2P%2ByRzwmONU3qFzeeNLZ0YhEg%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAbu1HIjYlqxPEMeE1WkliMLVBnzGLRhwks5sCCFngaJpZM4N0UQl&data=02%7C01%7Cv-muarum%40microsoft.com%7C95e06ed597224ac9c19908d4ae8b89c0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636325361716344036&sdata=JBXDBlIlXsn1bSFXDUzPLhazqH3i4rpZXbNFa7Re6Yo%3D&reserved=0.

msmohan avatar Jun 08 '17 16:06 msmohan

Adaptive Card support in MS Teams is still officially listed as "Coming Soon"

JasonSowers avatar Jun 08 '17 16:06 JasonSowers

Receipt card + Adaptive Cards are not currently supported in MS Teams.

nwhitmont avatar Jun 08 '17 16:06 nwhitmont

Yes sorry, here is the code for my Hero Card:

[LuisIntent("Help")]
 public async Task showBotInformation(IDialogContext context, LuisResult result)
 {
        var helpMsg = context.MakeMessage();
        var helpHeroCard = new HeroCard
        {
            Title = "Hi, I'm Bridget.",
            Text = "I'm here to provide easy, information. ",
            Buttons = new List<CardAction> {
                   new CardAction(ActionTypes.PostBack , "Common Qs" , value: "show common questions"),
                   new CardAction(ActionTypes.PostBack , "Settings" , value: "settings")
             }
        };
        helpMsg.Attachments.Add(helpHeroCard.ToAttachment());
        await context.PostAsync(helpMsg);
 }

The buttons trigger LUIS intents when the postback happens, but for some reason in teams all I see is the postback and the LUIS intent isn't triggered? I am using ngrok to test in teams.

meganlcooper avatar Jun 08 '17 17:06 meganlcooper

@meganlcooper PostBack is actually not supported in Teams. We have imBack and invoke, which are the separate pieces of PostBack (imBack for the text response, invoke for the silent JSON post.)

RichMoeMSFT avatar Jun 21 '17 15:06 RichMoeMSFT