Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
SuggestedActionsfeature 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:
CardActionandSuggestedActionsclasses 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]CardActionandSuggestedActionsfor JSON serialization inTeamsActivityJsonContext. (core/src/Microsoft.Teams.Bot.Apps/Schema/TeamsActivityJsonContext.cs)Integration with MessageActivity:
SuggestedActionsproperty intoMessageActivity, 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:
core/src/Microsoft.Teams.Bot.Apps/Schema/SuggestedActionsExtensions.cs)Testing and Validation:
core/test/Microsoft.Teams.Bot.Apps.UnitTests/SuggestedActionsTests.cs)