Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suggested Actions not visible in Microsoft Teams

I'll send a pro-active message from a bot to Microsoft Teams with 2 suggested actions that the user can take. But in Microsoft Teams the message is shown like this:

Notice that the message shows no suggested messages! At the Bot Framework Emulator, the same message looks like this:

What's wrong in Teams or my code?

Below is my code to authenticate, generate and send the message:

private async Task BotCallback(ITurnContext turnContext, CancellationToken cancellationToken)
{
    string serviceUrl = turnContext.Activity.RelatesTo.ServiceUrl;

    ConnectorClient Connector = new ConnectorClient(
        new Uri(serviceUrl),
        microsoftAppId: "[MicrosoftAppId]",
        microsoftAppPassword: "[MicrosoftAppPassword]"
    );

    AppCredentials.TrustServiceUrl(serviceUrl);
    ChannelAccount from = turnContext.Activity.From;
    IMessageActivity activity = MessageFactory.SuggestedActions(
        new string[] { "First action", "Second action" },
        $"Hi {userName},\r\nYou've missed some lorem ipsum dolor sit amet:\r\n- **consectetur:** Ut porttitor\r\nChoose an action from below to add them."
    );

    await Connector.Conversations.SendToConversationAsync(
        turnContext.Activity.Conversation.Id, 
        activity as Activity, 
        cancellationToken
    );
}
like image 842
H. Pauwelyn Avatar asked Nov 04 '25 07:11

H. Pauwelyn


1 Answers

Suggested actions are not supported in Teams. If you want to display buttons, you could use Cards in Teams.

like image 54
Gousia Begum Avatar answered Nov 07 '25 01:11

Gousia Begum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!