Language

ITurnMiddleware Interface

Definition

Defines a middleware component that can process or modify activities during a bot turn.

public interface ITurnMiddleware
type ITurnMiddleware = interface
Public Interface ITurnMiddleware

Remarks

Implement this interface to add custom logic before or after the bot processes an activity. Middleware can perform tasks such as logging, authentication, or altering activities. Multiple middleware components can be chained together; each should call the nextTurn delegate to continue the pipeline.

Methods

Name Description
OnTurnAsync(BotApplication, CoreActivity, NextTurn, CancellationToken)

Triggers the middleware to process an activity during a bot turn.

Applies to