Gated
Attaches gates to a handler. The gates run before executeexecute, and a gate refusing stops the handler with the reply or drop the gate threw. Multiple gates are ANDed, so each must pass. A gate that requires a context the handler does not provide (a button gate on a slash handler, an interaction gate on an event handler) is a compile error at this line, and the error names the gate and the handler kind. Place it above the route decorator.
Combine gates with andand or oror to build a single gate from multiple arms.
See also:defineGate, defineEffectGate
Gated<Gates>(
gates: Gates
): <TCtor extends AnyHandlerCtor>(
ctor: FitAll<TCtor, Gates> extends Gates
? TCtor
: FitAll<TCtor, Gates>
) => voidGated<Gates>(
gates: Gates
): <TCtor extends AnyHandlerCtor>(
ctor: FitAll<TCtor, Gates> extends Gates
? TCtor
: FitAll<TCtor, Gates>
) => voidGates
The non-empty tuple of gates to run, in order, against the handler's context.
GatesGatesThe non-empty tuple of gates to run, in order, against the handler's context.
gates
gates: Gatesgates: GatesOne or more gates to attach, each ANDed so the handler runs only when all pass.