• new YorClient(options
): YorClient
Creates a new instance of the class.
Name | Type | Description |
---|---|---|
options | YorClientOptions | The configuration options for the client. |
src/structures/YorClient.ts:95
• api: YorClientAPI
src/structures/YorClient.ts:83
• Readonly
commands: Collection
<string
, YorSlashCommand
>
src/structures/YorClient.ts:67
• Readonly
components: Collection
<string
, YorInteractionComponent
>
src/structures/YorClient.ts:68
• Readonly
messageCommands: Collection
<string
, YorMessageContextMenuCommand
>
src/structures/YorClient.ts:73
• middlewares: Record
<MiddlewareFunctionNames
, ((context
: CommandContext
) => void
| Promise
<void
> | (context
: MessageContextMenuCommandInteraction
) => void
| Promise
<void
> | (context
: CommandContext
) => void
| Promise
<void
> | (context
: ComponentContext
) => void
| Promise
<void
> | (context
: ModalContext
) => void
| Promise
<void
> | (context
: AutocompleteCommandContext
) => void
| Promise
<void
>)[]>
src/structures/YorClient.ts:85
• Readonly
modals: Collection
<string
, YorInteractionModal
>
src/structures/YorClient.ts:72
• Readonly
options: YorClientOptions
src/structures/YorClient.ts:66
• rest: REST
src/structures/YorClient.ts:82
• Readonly
userCommands: Collection
<string
, YorUserContextMenuCommand
>
src/structures/YorClient.ts:77
▸ createMiddleware<T
>(name
, middleware
): void
Creates middleware for a given name and adds it to the middlewares array.
Name | Type |
---|---|
T | extends MiddlewareFunctionNames |
Name | Type | Description |
---|---|---|
name | T | The name of the middleware. |
middleware | MiddlewareFunction <T > | The middleware function. |
void
src/structures/YorClient.ts:410
▸ deployCommands(guild?
): Promise
<RESTPutAPIApplicationCommandsResult
>
Deploys the commands to the API application and returns the result.
Name | Type |
---|---|
guild? | string |
Promise
<RESTPutAPIApplicationCommandsResult
>
The result of the deployment.
src/structures/YorClient.ts:246
▸ handleInteraction(request
): Promise
<APIInteractionResponse
>
Handles an interaction request from the API.
Name | Type | Description |
---|---|---|
request | Request | The request object containing the interaction data. |
Promise
<APIInteractionResponse
>
src/structures/YorClient.ts:423
▸ handleInteractionRequest(data
): Promise
<{ type
: InteractionResponseType
= InteractionResponseType.PONG }>
Handles the interaction request.
Name | Type | Description |
---|---|---|
data | APIInteraction | The interaction data. |
Promise
<{ type
: InteractionResponseType
= InteractionResponseType.PONG }>
src/structures/YorClient.ts:459
▸ registerCommand(command
): Collection
<string
, YorSlashCommand
>
Registers a slash command.
Name | Type | Description |
---|---|---|
command | YorSlashCommand | The slash command to register. |
Collection
<string
, YorSlashCommand
>
src/structures/YorClient.ts:119
▸ registerCommands(commands
): Collection
<string
, YorSlashCommand
>
Registers the provided slash commands.
Name | Type | Description |
---|---|---|
commands | YorSlashCommand [] | The slash commands to register. |
Collection
<string
, YorSlashCommand
>
src/structures/YorClient.ts:137
▸ registerComponent(component
): Collection
<string
, YorInteractionComponent
>
Registers a component in the collection.
Name | Type | Description |
---|---|---|
component | YorInteractionComponent | The component to register. |
Collection
<string
, YorInteractionComponent
>
src/structures/YorClient.ts:274
▸ registerComponents(components
): Collection
<string
, YorInteractionComponent
>
Registers the given components in the collection.
Name | Type | Description |
---|---|---|
components | YorInteractionComponent [] | The components to register. |
Collection
<string
, YorInteractionComponent
>
src/structures/YorClient.ts:293
▸ registerMessageCommand(command
): Collection
<string
, YorMessageContextMenuCommand
>
Registers a message command.
Name | Type | Description |
---|---|---|
command | YorMessageContextMenuCommand | The message command to register. |
Collection
<string
, YorMessageContextMenuCommand
>
src/structures/YorClient.ts:195
▸ registerModal(modal
): Collection
<string
, YorInteractionModal
>
Registers a modal in the collection.
Name | Type | Description |
---|---|---|
modal | YorInteractionModal | The modal to be registered. |
Collection
<string
, YorInteractionModal
>
src/structures/YorClient.ts:344
▸ registerModals(modals
): Collection
<string
, YorInteractionModal
>
Registers the given modals in the collection.
Name | Type | Description |
---|---|---|
modals | YorInteractionModal [] | The modals to be registered. |
Collection
<string
, YorInteractionModal
>
src/structures/YorClient.ts:361
▸ registerUserCommand(command
): Collection
<string
, YorUserContextMenuCommand
>
Registers a user command.
Name | Type | Description |
---|---|---|
command | YorUserContextMenuCommand | The user command to register. |
Collection
<string
, YorUserContextMenuCommand
>
src/structures/YorClient.ts:221
▸ unregisterAllCommands(): Collection
<string
, YorSlashCommand
>
Unregisters all slash commands.
Collection
<string
, YorSlashCommand
>
src/structures/YorClient.ts:184
▸ unregisterCommand(command
): Collection
<string
, YorSlashCommand
>
Unregisters a slash command.
Name | Type | Description |
---|---|---|
command | YorSlashCommand | The slash command to unregister. |
Collection
<string
, YorSlashCommand
>
src/structures/YorClient.ts:157
▸ unregisterCommands(commands
): Collection
<string
, YorSlashCommand
>
Unregisters the provided slash commands.
Name | Type | Description |
---|---|---|
commands | YorSlashCommand [] | The slash commands to unregister. |
Collection
<string
, YorSlashCommand
>
src/structures/YorClient.ts:170
▸ unregisterComponent(component
): Collection
<string
, YorInteractionComponent
>
Deletes the specified component from the collection and returns the updated collection.
Name | Type | Description |
---|---|---|
component | YorInteractionComponent | The component to unregister. |
Collection
<string
, YorInteractionComponent
>
src/structures/YorClient.ts:314
▸ unregisterComponents(components
): Collection
<string
, YorInteractionComponent
>
Unregisters components from the collection.
Name | Type | Description |
---|---|---|
components | YorInteractionComponent [] | The components to unregister. |
Collection
<string
, YorInteractionComponent
>
src/structures/YorClient.ts:328
▸ unregisterMessageCommand(command
): Collection
<string
, YorMessageContextMenuCommand
>
Unregisters a message command.
Name | Type | Description |
---|---|---|
command | YorMessageContextMenuCommand | The message command to unregister. |
Collection
<string
, YorMessageContextMenuCommand
>
src/structures/YorClient.ts:208
▸ unregisterModal(modal
): Collection
<string
, YorInteractionModal
>
Deletes the specified modal from the collection and returns the updated collection.
Name | Type | Description |
---|---|---|
modal | YorInteractionModal | The modal to unregister. |
Collection
<string
, YorInteractionModal
>
src/structures/YorClient.ts:380
▸ unregisterModals(modals
): Collection
<string
, YorInteractionModal
>
Unregisters modals from the collection.
Name | Type | Description |
---|---|---|
modals | YorInteractionModal [] | The modals to unregister. |
Collection
<string
, YorInteractionModal
>
src/structures/YorClient.ts:394
▸ unregisterUserCommand(command
): Collection
<string
, YorUserContextMenuCommand
>
Unregisters a user command.
Name | Type | Description |
---|---|---|
command | YorUserContextMenuCommand | The user command to unregister. |
Collection
<string
, YorUserContextMenuCommand
>