Skip to main content

Class: ApplicationCommandRegistry

Constructors

constructor

new ApplicationCommandRegistry(commandName): ApplicationCommandRegistry

Parameters

NameType
commandNamestring

Returns

ApplicationCommandRegistry

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:87

Properties

apiCalls

Private Readonly apiCalls: InternalAPICall[] = []

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:85


chatInputCommands

Readonly chatInputCommands: Set<string>

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

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:38


commandName

Readonly commandName: string

The piece this registry is for.

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:32


contextMenuCommands

Readonly contextMenuCommands: Set<string>

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

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:44


globalChatInputCommandIds

Readonly globalChatInputCommandIds: Set<string>

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

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:61


globalCommandId

globalCommandId: null | string = null

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.

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:56


globalContextMenuCommandIds

Readonly globalContextMenuCommandIds: Set<string>

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

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:66


guildCommandIds

Readonly guildCommandIds: Collection<string, string>

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.

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:73


guildIdToChatInputCommandIds

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

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

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:78


guildIdToContextMenuCommandIds

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

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

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:83


guildIdsToFetch

Readonly guildIdsToFetch: Set<string>

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

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:49

Accessors

command

get command(): undefined | Command<Args, CommandOptions>

Returns

undefined | Command<Args, CommandOptions>

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:91

Methods

addChatInputCommandIds

addChatInputCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

NameType
...commandIdsstring[] | string[][]

Returns

ApplicationCommandRegistry

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:197


addChatInputCommandNames

addChatInputCommandNames(...names): ApplicationCommandRegistry

Parameters

NameType
...namesstring[] | string[][]

Returns

ApplicationCommandRegistry

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:167


addContextMenuCommandIds

addContextMenuCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

NameType
...commandIdsstring[] | string[][]

Returns

ApplicationCommandRegistry

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:218


addContextMenuCommandNames

addContextMenuCommandNames(...names): ApplicationCommandRegistry

Parameters

NameType
...namesstring[] | string[][]

Returns

ApplicationCommandRegistry

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:182


createMissingCommand

createMissingCommand(commandsManager, apiData, type, guildId?): Promise<void>

Parameters

NameType
commandsManagerApplicationCommandManager<ApplicationCommand<{ guild: GuildResolvable }>, { guild: GuildResolvable }, null>
apiDataRESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody
typestring
guildId?string

Returns

Promise<void>

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:521


debug

debug(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:570


error

error(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:562


getGuildIdsToRegister

getGuildIdsToRegister(options?): undefined | string[]

Parameters

NameType
options?RegisterOptions

Returns

undefined | string[]

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:311


handleAPICall

handleAPICall(commandsManager, globalCommands, allGuildsCommands, apiCall): Promise<void>

Parameters

NameType
commandsManagerApplicationCommandManager<ApplicationCommand<{ guild: GuildResolvable }>, { guild: GuildResolvable }, null>
globalCommandsCollection<string, ApplicationCommand<>>
allGuildsCommandsMap<string, Collection<string, ApplicationCommand<>>>
apiCallInternalAPICall

Returns

Promise<void>

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:332


handleCommandPresent

handleCommandPresent(applicationCommand, apiData, behaviorIfNotEqual, guildId): Promise<void>

Parameters

NameType
applicationCommandApplicationCommand<>
apiDataRESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody
behaviorIfNotEqualRegisterBehavior
guildIdnull | string

Returns

Promise<void>

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:421


handleIdAddition

handleIdAddition(type, id, guildId?): void

Parameters

NameType
typeInternalRegistryAPIType
idstring
guildId?null | string

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:275


info

info(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:558


logCommandDifferencesFound

logCommandDifferencesFound(applicationCommand, logAsWarn, differences): void

Parameters

NameType
applicationCommandApplicationCommand<>
logAsWarnboolean
differencesCommandDifference[]

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:500


processGuildIds

processGuildIds(guildIdsToRegister): void

Parameters

NameType
guildIdsToRegisterundefined | string[]

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:323


registerChatInputCommand

registerChatInputCommand(command, options?): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:95


registerContextMenuCommand

registerContextMenuCommand(command, options?): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:132


runAPICalls

runAPICalls(applicationCommands, globalCommands, guildCommands): Promise<void>

Parameters

NameType
applicationCommandsApplicationCommandManager<ApplicationCommand<{ guild: GuildResolvable }>, { guild: GuildResolvable }, null>
globalCommandsCollection<string, ApplicationCommand<>>
guildCommandsMap<string, Collection<string, ApplicationCommand<>>>

Returns

Promise<void>

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:239


trace

trace(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:574


warn

warn(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:566