TeamsActivityHandler.OnInvokeActivityAsync Method

Definition

Invoked when an invoke activity is received from the connector. Invoke activities can be used to communicate many different things.

protected override System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse> OnInvokeActivityAsync (Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IInvokeActivity> turnContext, System.Threading.CancellationToken cancellationToken);
override this.OnInvokeActivityAsync : Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IInvokeActivity> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse>
Protected Overrides Function OnInvokeActivityAsync (turnContext As ITurnContext(Of IInvokeActivity), cancellationToken As CancellationToken) As Task(Of InvokeResponse)

Parameters

turnContext
ITurnContext<IInvokeActivity>

A strongly-typed context object for this turn.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

Invoke activities communicate programmatic commands from a client or channel to a bot. The meaning of an invoke activity is defined by the Name property, which is meaningful within the scope of a channel.

Applies to