BotHandler type

Describes a bot activity event handler, for use with an ActivityHandler object.

type BotHandler = (
  context: TurnContext,
  next: () => Promise<void>
) => Promise<any>

Remarks

Parameters

Name Type Description
context TurnContext The context object for the turn.
next () => Promise A continuation function for handling the activity.

Returns

any

The incoming activity is contained in the context object's activity property. Call the next function to continue the processing of activity events. Not doing so will stop propagation of events for this activity.

A bot activity handler can return a value, to support invoke activities.