Search code examples
c#azurebotframeworkazure-bot-service

Thumbnail card with buttons to Telegram channel produces InternalServerError


Sending thumbnailcard to telegram channel produces following exception. This is working fine in emulator.

Operation returned an invalid status code 'InternalServerError'

Here is the code for card:

var Card = new ThumbnailCard(cardHeading, BotName)
{
    Buttons = new List<CardAction>
    {
        new CardAction(ActionTypes.ImBack, "MyProfile", text:"MyProfile", displayText: "MyProfile", value: "MyProfile"),
        new CardAction(ActionTypes.ImBack, "MyBadges", text:"MyBadges", displayText: "MyBadges", value: "MyBadges"),
        new CardAction(ActionTypes.ImBack, "MyActivity", text:"MyActivity", displayText: "MyActivity", value: "MyActivity"),
        new CardAction(ActionTypes.ImBack, "LogOut", text: "LogOut", displayText: "LogOut", value: "LogOut")
    },
    Images = new List<CardImage>()
    {
        new CardImage()
        {
            Url = string.Format("data:image/png;base64,{0}", strBase64Image)
        }
    }
};


Solution

  • I doubt your CardImage Url format is correct. could you please try with below code snippet

    Images = new List<CardImage> { new CardImage("https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg") } 
    

    Point To Remember:

    Emulator could manage many of the issue itself where channel always doesn't.

    And Let me know if is it working