Skip to content
Functioncorev0.14.0Decorator

RegisterInteractionMiddleware

Registers an interaction middleware. It runs after the dispatcher builds the handler and before its gates, over that handler's reply surface.

Throws:

  • A SeedcordTypeError when priority is not a finite number.

RegisterInteractionMiddleware<Kinds>(
    options?: InteractionMiddlewareOptions<Kinds>
): <TCtor extends AnyMiddlewareCtor>(
    ctor: AssertMiddlewareKinds<Kinds[number], TCtor>
) => void
\@RegisterInteractionMiddleware({ kinds: [InteractionKind.Button], priority: 10 })
class Audit extends InteractionMiddleware<InteractionKind.Button> {
    async execute() {
        this.logger.info(this.dispatch.routeId);
    }
}

Kinds

Kinds