@pikokr/command.ts / Exports
@pikokr/command.ts
Table of contents
Classes
- ApplicationCommandComponent
- ApplicationCommandExtension
- BaseComponent
- CommandClient
- ComponentArgument
- ComponentArgumentDecorator
- ConverterComponent
- Extension
- ListenerComponent
- OwnerOnlyError
- Registry
- SubCommandGroup
- SubCommandGroupChild
- TextCommandComponent
- TextCommandRestOption
Type Aliases
- ApplicationCommandComponentOptions
- ApplicationCommandExtensionConfig
- ArgumentConvertOptions
- ArgumentConvertOptionsArg
- ComponentArgumentStore
- ComponentHookFn
- ComponentHookStore
- ComponentStore
- ListenerOptions
- ListenerOptionsArg
- ModuleHookStore
- TextCommandConfig
- TextCommandOptions
Functions
- applicationCommand
- argConverter
- command
- createArgumentDecorator
- createCheckDecorator
- createComponentDecorator
- createComponentHook
- getComponent
- getComponentArgumentStore
- getComponentStore
- getModuleHookStore
- listener
- mergeMethodDecorators
- moduleHook
- option
- ownerOnly
- rest
Type Aliases
ApplicationCommandComponentOptions
Ƭ ApplicationCommandComponentOptions: UserApplicationCommandData | MessageApplicationCommandData | Omit<ChatInputApplicationCommandData, "options"> & { guilds?: Snowflake[] ; type: ApplicationCommandType }
Defined in
src/applicationCommand/ApplicationCommand.ts:6 (opens in a new tab)
ApplicationCommandExtensionConfig
Ƭ ApplicationCommandExtensionConfig: Object
Type declaration
| Name | Type |
|---|---|
guilds? | Snowflake[] |
Defined in
src/applicationCommand/ApplicationCommandExtension.ts:32 (opens in a new tab)
ArgumentConvertOptions
Ƭ ArgumentConvertOptions<T>: Object
Type parameters
| Name |
|---|
T |
Type declaration
| Name | Type |
|---|---|
component | unknown |
parameterless | boolean |
type | T |
Defined in
src/core/converter/index.ts:4 (opens in a new tab)
ArgumentConvertOptionsArg
Ƭ ArgumentConvertOptionsArg<T>: Omit<ArgumentConvertOptions<T>, "parameterless"> & { parameterless?: boolean }
Type parameters
| Name |
|---|
T |
Defined in
src/core/converter/index.ts:6 (opens in a new tab)
ComponentArgumentStore
Ƭ ComponentArgumentStore: Collection<number, ComponentArgumentDecorator>
Defined in
src/core/components/decoratorCreator.ts:9 (opens in a new tab)
ComponentHookFn
Ƭ ComponentHookFn<T>: (...args: T) => void | Promise<void>
Type parameters
| Name | Type |
|---|---|
T | extends unknown[] |
Type declaration
▸ (...args): void | Promise<void>
Parameters
| Name | Type |
|---|---|
...args | T |
Returns
void | Promise<void>
Defined in
src/core/hooks/componentHook.ts:4 (opens in a new tab)
ComponentHookStore
Ƭ ComponentHookStore: Collection<string, ComponentHookFn<unknown[]>[]>
Defined in
src/core/hooks/componentHook.ts:6 (opens in a new tab)
ComponentStore
Ƭ ComponentStore: Collection<string | symbol, BaseComponent>
Defined in
src/core/components/decoratorCreator.ts:8 (opens in a new tab)
ListenerOptions
Ƭ ListenerOptions: Object
Type declaration
| Name | Type |
|---|---|
emitter | string |
event | string |
Defined in
src/core/listener/index.ts:5 (opens in a new tab)
ListenerOptionsArg
Ƭ ListenerOptionsArg: Object
Type declaration
| Name | Type |
|---|---|
emitter? | string |
event | string |
Defined in
src/core/listener/index.ts:7 (opens in a new tab)
ModuleHookStore
Ƭ ModuleHookStore: Collection<string, ComponentHookFn<unknown[]>[]>
Defined in
src/core/hooks/moduleHook.ts:5 (opens in a new tab)
TextCommandConfig
Ƭ TextCommandConfig: Object
Type declaration
| Name | Type |
|---|---|
prefix | string | string[] | (msg: Message) => Promise<string | string[]> | string | string[] |
Defined in
src/textCommand/TextCommandExtension.ts:8 (opens in a new tab)
TextCommandOptions
Ƭ TextCommandOptions: Object
Type declaration
| Name | Type |
|---|---|
aliases? | string[] |
description? | string |
name | string |
Defined in
src/textCommand/TextCommand.ts:4 (opens in a new tab)
Functions
applicationCommand
▸ applicationCommand(options): MethodDecorator
Parameters
| Name | Type |
|---|---|
options | ApplicationCommandComponentOptions |
Returns
MethodDecorator
Defined in
src/applicationCommand/ApplicationCommand.ts:24 (opens in a new tab)
argConverter
▸ argConverter<T>(options): MethodDecorator
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
options | ArgumentConvertOptionsArg<T> |
Returns
MethodDecorator
Defined in
src/core/converter/index.ts:18 (opens in a new tab)
command
▸ command(options): MethodDecorator
Parameters
| Name | Type |
|---|---|
options | TextCommandOptions |
Returns
MethodDecorator
Defined in
src/textCommand/TextCommand.ts:16 (opens in a new tab)
createArgumentDecorator
▸ createArgumentDecorator<Options>(type): (options: Options) => ParameterDecorator
Type parameters
| Name |
|---|
Options |
Parameters
| Name | Type |
|---|---|
type | typeof ComponentArgumentDecorator |
Returns
fn
▸ (options): ParameterDecorator
Parameters
| Name | Type |
|---|---|
options | Options |
Returns
ParameterDecorator
Defined in
src/core/components/decoratorCreator.ts:61 (opens in a new tab)
createCheckDecorator
▸ createCheckDecorator(fn): MethodDecorator
Parameters
| Name | Type |
|---|---|
fn | ComponentHookFn<[CommandClient, Interaction | Message<boolean>]> |
Returns
MethodDecorator
Defined in
src/core/utils/checks.ts:8 (opens in a new tab)
createComponentDecorator
▸ createComponentDecorator(component): MethodDecorator
Parameters
| Name | Type |
|---|---|
component | BaseComponent |
Returns
MethodDecorator
Defined in
src/core/components/decoratorCreator.ts:29 (opens in a new tab)
createComponentHook
▸ createComponentHook<T>(name, fn): MethodDecorator
Type parameters
| Name | Type |
|---|---|
T | extends unknown[] |
Parameters
| Name | Type |
|---|---|
name | string |
fn | ComponentHookFn<T> |
Returns
MethodDecorator
Defined in
src/core/hooks/componentHook.ts:19 (opens in a new tab)
getComponent
▸ getComponent(target, key): undefined | BaseComponent
Parameters
| Name | Type |
|---|---|
target | object |
key | string | symbol |
Returns
undefined | BaseComponent
Defined in
src/core/components/decoratorCreator.ts:23 (opens in a new tab)
getComponentArgumentStore
▸ getComponentArgumentStore(target, key): ComponentArgumentStore
Parameters
| Name | Type |
|---|---|
target | object |
key | string | symbol |
Returns
Defined in
src/core/components/decoratorCreator.ts:49 (opens in a new tab)
getComponentStore
▸ getComponentStore(target): ComponentStore
Parameters
| Name | Type |
|---|---|
target | object |
Returns
Defined in
src/core/components/decoratorCreator.ts:11 (opens in a new tab)
getModuleHookStore
▸ getModuleHookStore(target): ModuleHookStore
Parameters
| Name | Type |
|---|---|
target | object |
Returns
Defined in
src/core/hooks/moduleHook.ts:7 (opens in a new tab)
listener
▸ listener(options): MethodDecorator
Parameters
| Name | Type |
|---|---|
options | ListenerOptionsArg |
Returns
MethodDecorator
Defined in
src/core/listener/index.ts:19 (opens in a new tab)
mergeMethodDecorators
▸ mergeMethodDecorators(decorators): MethodDecorator
Parameters
| Name | Type |
|---|---|
decorators | MethodDecorator[] |
Returns
MethodDecorator
Defined in
src/core/utils/decorators.ts:1 (opens in a new tab)
moduleHook
▸ moduleHook(name): MethodDecorator
Parameters
| Name | Type |
|---|---|
name | string |
Returns
MethodDecorator
Defined in
src/core/hooks/moduleHook.ts:19 (opens in a new tab)
option
▸ option(options): ParameterDecorator
Parameters
| Name | Type |
|---|---|
options | ApplicationCommandOptionData |
Returns
ParameterDecorator
Defined in
src/core/components/decoratorCreator.ts:62 (opens in a new tab)
ownerOnly
▸ ownerOnly<T>(target, propertyKey, descriptor): void | TypedPropertyDescriptor<T>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
target | Object |
propertyKey | string | symbol |
descriptor | TypedPropertyDescriptor<T> |
Returns
void | TypedPropertyDescriptor<T>
Defined in
node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts:21
rest
▸ rest(options): ParameterDecorator
Parameters
| Name | Type |
|---|---|
options | void |
Returns
ParameterDecorator
Defined in
src/core/components/decoratorCreator.ts:62 (opens in a new tab)