Skip to content

Add SuggestedActions support#383

Open
rido-min wants to merge 3 commits intonext/corefrom
next/core-suggestedactions
Open

Add SuggestedActions support#383
rido-min wants to merge 3 commits intonext/corefrom
next/core-suggestedactions

Conversation

@rido-min
Copy link
Member

This pull request introduces a new SuggestedActions feature for message activities, enabling quick reply buttons and card actions in Microsoft Teams bots. The changes include new schema classes, extension methods for easier usage, and comprehensive unit tests to ensure correct serialization, deserialization, and fluent API behavior.

Schema and Serialization Enhancements:

  • Added new CardAction and SuggestedActions classes to represent quick reply actions and their recipients, including common action types as constants. (core/src/Microsoft.Teams.Bot.Apps/Schema/CardAction.cs, core/src/Microsoft.Teams.Bot.Apps/Schema/SuggestedActions.cs) [1] [2]
  • Registered CardAction and SuggestedActions for JSON serialization in TeamsActivityJsonContext. (core/src/Microsoft.Teams.Bot.Apps/Schema/TeamsActivityJsonContext.cs)

Integration with MessageActivity:

  • Integrated SuggestedActions property into MessageActivity, including support for deserialization from JSON and removal of legacy code. (core/src/Microsoft.Teams.Bot.Apps/Schema/Activities/MessageActivity.cs) [1] [2] [3] [4] [5]

Developer Experience Improvements:

  • Added extension methods to simplify adding and chaining suggested actions to message activities. (core/src/Microsoft.Teams.Bot.Apps/Schema/SuggestedActionsExtensions.cs)

Testing and Validation:

  • Introduced a comprehensive unit test suite to verify all aspects of the new suggested actions feature, including serialization, deserialization, fluent API, and extension methods. (core/test/Microsoft.Teams.Bot.Apps.UnitTests/SuggestedActionsTests.cs)

rido-min and others added 2 commits March 19, 2026 18:14
Implement CardAction, CardActionTypes, SuggestedActions model and extension
methods for MessageActivity in the core project. This enables bots to present
quick-reply action buttons to users in message activities, matching the
Libraries implementation pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replaces CardAction with SuggestedAction and ActionType constants for Teams bot suggested actions. Updates SuggestedActions to use IList<SuggestedAction>, modifies message handlers and tests to use the new type, and extends TeamsActivity and builder for direct suggested actions support. Removes obsolete extension methods.
@rido-min rido-min changed the title Add SuggestedActions support to MessageActivity Add SuggestedActions support Mar 20, 2026
@rido-min rido-min marked this pull request as ready for review March 20, 2026 21:06
@rido-min rido-min requested a review from MehakBindra March 20, 2026 21:06
@rido-min rido-min added the CORE label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant