Skip to content

gunshi / default / CommandDecorator

Type Alias: CommandDecorator()<G>

ts
type CommandDecorator<G> = (baseRunner) => (ctx) => Awaitable<void | string>;

Command decorator. A function that wraps a command runner to add or modify its behavior.

Type Parameters

Type ParameterDefault type
G extends GunshiParams<any>DefaultGunshiParams

Parameters

ParameterTypeDescription
baseRunner(ctx) => Awaitable<void | string>The base command runner to decorate

Returns

The decorated command runner

ts
(ctx): Awaitable<void | string>;

Parameters

ParameterType
ctxReadonly<CommandContext<G>>

Returns

Awaitable<void | string>

Released under the MIT License.