SendActivitiesHandler type

A handler that can participate in send activity events for the current turn.

type SendActivitiesHandler = (
  context: TurnContext,
  activities: Partial<Activity>[],
  next: () => Promise<ResourceResponse[]>
) => Promise<ResourceResponse[]>

Remarks

Parameters

Name Type Description
context TurnContext The context object for the turn.
activities Partial<Activity>[] The activities to send.
next () => Promise<ResourceResponse[]> The function to call to continue event processing.

Returns

Promise<ResourceResponse[]>

A handler calls the next function to pass control to the next registered handler. If a handler doesn't call the next function, the adapter does not call any of the subsequent handlers and does not send the activities to the user.

If the activities are successfully sent, the next function returns an array of ResourceResponse objects containing the IDs that the receiving channel assigned to the activities. Use this array as the return value of this handler.

See also