Skip to main content

Class: ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:31

Constructors

new ApplicationCommandRegistry()

new ApplicationCommandRegistry(commandName: string): ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:90

Parameters

ParameterType
commandNamestring

Returns

ApplicationCommandRegistry

Properties

chatInputCommands

readonly chatInputCommands: Set<string>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:41

A set of all chat input command names and ids that point to this registry. You should not use this field directly, but instead use ApplicationCommandRegistry.globalChatInputCommandIds


commandName

readonly commandName: string

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:35

The piece this registry is for.


contextMenuCommands

readonly contextMenuCommands: Set<string>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:47

A set of all context menu command names and ids that point to this registry. You should not use this field directly, but instead use ApplicationCommandRegistry.globalContextMenuCommandIds


globalChatInputCommandIds

readonly globalChatInputCommandIds: Set<string>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:64

A set of all registered and valid global chat input command ids that point to this registry.


globalCommandId

globalCommandId: null | string = null

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:59

The global slash command id for this command.

Deprecated

This field will only show the first global command id registered for this registry. Use ApplicationCommandRegistry.globalChatInputCommandIds instead.


globalContextMenuCommandIds

readonly globalContextMenuCommandIds: Set<string>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:69

A set of all registered and valid global context menu command ids that point to this registry.


guildCommandIds

readonly guildCommandIds: Collection<string, string>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:76

The guild command ids for this command.

Deprecated

This field will only show the first guild command id registered for this registry per guild. Use ApplicationCommandRegistry.guildIdToChatInputCommandIds and ApplicationCommandRegistry.guildIdToContextMenuCommandIds instead.


guildIdsToFetch

readonly guildIdsToFetch: Set<string>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:52

The guild ids that we need to fetch the commands for.


guildIdToChatInputCommandIds

readonly guildIdToChatInputCommandIds: Collection<string, Set<string>>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:81

A map of guild ids to a set of registered and valid chat input command ids that point to this registry.


guildIdToContextMenuCommandIds

readonly guildIdToContextMenuCommandIds: Collection<string, Set<string>>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:86

A map of guild ids to a set of registered and valid context menu command ids that point to this registry.

Accessors

command

Get Signature

get command(): undefined | Command

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:94

Returns

undefined | Command

Methods

addChatInputCommandIds()

addChatInputCommandIds(...commandIds: string[] | string[][]): ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:206

Parameters

ParameterType
...commandIdsstring[] | string[][]

Returns

ApplicationCommandRegistry


addChatInputCommandNames()

addChatInputCommandNames(...names: string[] | string[][]): ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:176

Parameters

ParameterType
...namesstring[] | string[][]

Returns

ApplicationCommandRegistry


addContextMenuCommandIds()

addContextMenuCommandIds(...commandIds: string[] | string[][]): ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:227

Parameters

ParameterType
...commandIdsstring[] | string[][]

Returns

ApplicationCommandRegistry


addContextMenuCommandNames()

addContextMenuCommandNames(...names: string[] | string[][]): ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:191

Parameters

ParameterType
...namesstring[] | string[][]

Returns

ApplicationCommandRegistry


handleIdAddition()

protected handleIdAddition(type: InternalRegistryAPIType, id: string, guildId?: null | string): void

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:284

Parameters

ParameterType
typeInternalRegistryAPIType
idstring
guildId?null | string

Returns

void


registerChatInputCommand()

registerChatInputCommand(command: SlashCommandBuilder | SlashCommandOptionsOnlyBuilder | SlashCommandSubcommandsOnlyBuilder | ChatInputApplicationCommandData | Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup"> | (builder: SlashCommandBuilder) => unknown, options?: RegisterOptions): ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:98

Parameters

ParameterType
commandSlashCommandBuilder | SlashCommandOptionsOnlyBuilder | SlashCommandSubcommandsOnlyBuilder | ChatInputApplicationCommandData | Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup"> | (builder: SlashCommandBuilder) => unknown
options?RegisterOptions

Returns

ApplicationCommandRegistry


registerContextMenuCommand()

registerContextMenuCommand(command: ContextMenuCommandBuilder | UserApplicationCommandData | MessageApplicationCommandData | (builder: ContextMenuCommandBuilder) => unknown, options?: RegisterOptions): ApplicationCommandRegistry

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:138

Parameters

ParameterType
commandContextMenuCommandBuilder | UserApplicationCommandData | MessageApplicationCommandData | (builder: ContextMenuCommandBuilder) => unknown
options?RegisterOptions

Returns

ApplicationCommandRegistry


runAPICalls()

protected runAPICalls(applicationCommands: ApplicationCommandManager, globalCommands: Collection<string, ApplicationCommand>, guildCommands: Map<string, Collection<string, ApplicationCommand>>): Promise<void>

Defined in: projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:248

Parameters

ParameterType
applicationCommandsApplicationCommandManager
globalCommandsCollection<string, ApplicationCommand>
guildCommandsMap<string, Collection<string, ApplicationCommand>>

Returns

Promise<void>