RegisterClassMiddleware class

Middleware for adding an object to or registering a service with the current turn context.

Constructors

RegisterClassMiddleware(T, string | symbol)

Initialize a new instance of the RegisterClassMiddleware class.

Properties

service

The object or service to add to the turn context.

Methods

onTurn(TurnContext, () => Promise<void>)

Adds the associated object or service to the current turn context.

Constructor Details

RegisterClassMiddleware(T, string | symbol)

Initialize a new instance of the RegisterClassMiddleware class.

new RegisterClassMiddleware(service: T, key: string | symbol)

Parameters

service

T

The object or service to add.

key

string | symbol

The key for service object in turn state.

Property Details

service

The object or service to add to the turn context.

service: T

Property Value

T

Method Details

onTurn(TurnContext, () => Promise<void>)

Adds the associated object or service to the current turn context.

function onTurn(turnContext: TurnContext, next: () => Promise<void>): Promise<void>

Parameters

turnContext
TurnContext

The context object for this turn.

next

() => Promise<void>

The delegate to call to continue the bot middleware pipeline.

Returns

Promise<void>