Dispatcher utter_button_message not showing up in MS Teams

I have been trying to use dispatcher.utter_button_message in my custom actions for rasa. I have also integrated with MS Teams, and when I use the utter_button_message, I get a response on teams that says “This card’s content could not be displayed”. Is this an issue with how I am implementing the button, or could it be an issue with teams? I have attached a part of my debugger.

Core Version: 0.14.0 NLU Version: 0.15.0-spacy custom_core_sdk: 0.13.1

I got working buttons by adding type parameter:

type: 'imBack'
payload: '/affrm
title: 'Ok'

or type: 'postBack'

Source: Add rich card attachments to messages - Bot Service | Microsoft Docs

Thank you so much. That was very helpful

Do you think there is any way to dispatch adaptive cards from microsoft teams using custom actions?

1 Like

I want to send some MS card to ms teams bot,I am trying to send this url by using the format given on the link : https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-actions

But i get an error : 2020-02-26 01:21:45 ERROR rasa.core.channels.botframework - Error trying to send botframework messge. Response: {“error”:{“code”:“BadArgument”,“message”:“Unknown activity type”}

Below is my custom action which is invoked.

class ActionHelloWorld(Action):

def name(self) -> Text:
    return "action_hello_world"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    message = {
        "type": "openUrl",
        "title": "Tabs in Teams",
        "value": "https://msdn.microsoft.com/microsoft-teams/tabs"
    }

    dispatcher.utter_message(json_message=message)

    return []

did you find a solution? I run in the same problem

Hello!

I developed a bot using Rasa, and it’s currently connected to an Azure Bot via a webhook, and I have it activated on the Teams channel. In general, it’s functioning normally and provides responses within the Teams bot conversation. However, there are occasions when I’m using dispatcher.utter_message(text="example text") in the actions.py file to display messages within the bot conversation, but although no error is generated, the response message isn’t displayed within the conversation. Typically, the dispatcher works fine, even with AdaptiveCards that I’m using for Teams, but sometimes the messages fail to appear. I’ve been thinking that there might be a time limit, and after this time, it’s not possible to display the message with the dispatcher within the bot in Teams.

I would appreciate it if someone has knowledge about this and can clarify this issue for me.

Thank you!