Skip to content

Type Alias: Plugin<E>

Gunshi plugin, which is a function that receives a PluginContext.

Since

v0.27.0

Signature

ts
export type Plugin<E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']> = PluginFunction & { id: string; name?: string; dependencies?: (PluginDependency | string)[]; extension?: CommandContextExtension<E> }

Type Parameters

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

Properties

NameTypeDescription
dependencies (optional)(PluginDependency | string)[]
extension (optional)CommandContextExtension<E>
idstring
name (optional)string

Parameters

NameTypeDescription
ctxReadonly<PluginContext<G>>A PluginContext.

Returns

Awaitable<void> — An Awaitable that resolves when the plugin is loaded.

Released under the MIT License.