Suggested actions are not supported in teams, I get that. People are suggesting to use cards. I get that too. Now let's be more specific. I want to make a card that will behave in the same way that suggested actions behave, specifically:
Here is what I have so far, and it doesn't seem to be doing the trick:
actions = []
for button in buttons:
actions.append(
CardAction(
#type=ActionTypes.message_back,
type=ActionTypes.im_back,
value=button,
title=button,
text=button,
)
)
# card = CardFactory.adaptive_card(
# {
# {
# "type": "Action.Submit",
# "title": "Click me for imBack",
# "data": "Text to reply in chat"
# }
# }
# )
card = HeroCard(buttons=actions)
await self.global_tc.send_activity(MessageFactory.attachment(CardFactory.hero_card(card)))
It's been possible for a long time to update the content of an existing message that a bot has sent already, by passing the Action Id back as part of your payload, but there's another option more recently as well in the form of Universal Actions, which let you modify the state of the 'form' after an action has been taken. They only apply to Adaptive Cards, not Hero cards, but what you're doing in your screenshot is more applicable to Adaptive Cards anyway.
Please see here for more info: https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/universal-actions-for-adaptive-cards/overview?tabs=mobile
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.