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:90

Properties

apiCalls

Private Readonly apiCalls: InternalAPICall[] = []

Defined in

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


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:41


commandName

Readonly commandName: string

The piece this registry is for.

Defined in

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


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:47


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:64


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:59


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:69


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:76


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:81


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:86


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:52

Accessors

command

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

Returns

undefined | Command<Args, CommandOptions>

Defined in

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

Methods

addChatInputCommandIds

addChatInputCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addChatInputCommandNames

addChatInputCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandIds

addContextMenuCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandNames

addContextMenuCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


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:530


debug

debug(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


error

error(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


getGuildIdsToRegister

getGuildIdsToRegister(options?): undefined | string[]

Parameters

NameType
options?RegisterOptions

Returns

undefined | string[]

Defined in

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


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:341


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:430


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:284


info

info(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


logCommandDifferencesFound

logCommandDifferencesFound(applicationCommand, logAsWarn, differences): void

Parameters

NameType
applicationCommandApplicationCommand<>
logAsWarnboolean
differencesCommandDifference[]

Returns

void

Defined in

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


processGuildIds

processGuildIds(guildIdsToRegister): void

Parameters

NameType
guildIdsToRegisterundefined | string[]

Returns

void

Defined in

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


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:98


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:138


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:248


trace

trace(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


warn

warn(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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