Skip to content

Interface: CommandContextExtension<E> ​

Command context extension

Since ​

v0.27.0

Signature ​

ts
export interface CommandContextExtension<
  E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']
>

Type Parameters ​

NameDescription
E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']A type extending GunshiParams.extensions to specify the shape of the extension.

Properties ​

NameTypeDescription
factory (readonly)(ctx: CommandContextCore, cmd: Command) => Awaitable<E>Plugin extension factory
key (readonly)symbolPlugin identifier
onFactory (optional, readonly)(ctx: Readonly<CommandContext>, cmd: Readonly<Command>) => Awaitable<void>Plugin extension factory after hook

factory Parameters ​

NameTypeDescription
ctxCommandContextCore
cmdCommand

factory Returns ​

Awaitable<E>

onFactory Parameters ​

NameTypeDescription
ctxReadonly<CommandContext>
cmdReadonly<Command>

onFactory Returns ​

Awaitable<void>

Released under the MIT License.