Jaa


ActivityHandler.OnEventAsync Method

Definition

Invoked when an event other than tokens/response is received when the base behavior of OnEventActivityAsync(ITurnContext<IEventActivity>, CancellationToken) is used. This method could optionally be overridden if the bot is meant to handle miscellaneous events. By default, this method does nothing.

protected virtual System.Threading.Tasks.Task OnEventAsync (Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IEventActivity> turnContext, System.Threading.CancellationToken cancellationToken);
abstract member OnEventAsync : Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IEventActivity> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.OnEventAsync : Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IEventActivity> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overridable Function OnEventAsync (turnContext As ITurnContext(Of IEventActivity), cancellationToken As CancellationToken) As Task

Parameters

turnContext
ITurnContext<IEventActivity>

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

When the OnEventActivityAsync(ITurnContext<IEventActivity>, CancellationToken) method receives an event with a Name other than `tokens/response`, it calls this method.

Applies to

See also