MessageExtensions<TState>.OnCardButtonClicked Method

Definition

Registers a handler that implements the logic when a user has clicked on a button in a Message Extension card.

public Microsoft.Teams.AI.Application<TState> OnCardButtonClicked(Microsoft.Teams.AI.CardButtonClickedHandler<TState> handler);
member this.OnCardButtonClicked : Microsoft.Teams.AI.CardButtonClickedHandler<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnCardButtonClicked (handler As CardButtonClickedHandler(Of TState)) As Application(Of TState)

Parameters

handler
CardButtonClickedHandler<TState>

Function to call when the event is triggered.

Returns

The application instance for chaining purposes.

Remarks

The `composeExtension/onCardButtonClicked` INVOKE activity does not contain any sort of command ID, so only a single select item handler can be registered. Developers will need to include a type name of some sort in the preview item they return if they need to support multiple select item handlers.

Applies to