Skip to main content

Class: ApplicationCommandRegistry

Constructors

constructor

new ApplicationCommandRegistry(commandName)

Parameters

NameType
commandNamestring

Defined in

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

Properties

apiCalls

Private Readonly apiCalls: InternalAPICall[] = []

Defined in

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


chatInputCommands

Readonly chatInputCommands: Set<string>

Defined in

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


commandName

Readonly commandName: string

Defined in

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


contextMenuCommands

Readonly contextMenuCommands: Set<string>

Defined in

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


globalCommandId

globalCommandId: null | string = null

Defined in

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


guildCommandIds

Readonly guildCommandIds: Map<string, string>

Defined in

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


guildIdsToFetch

Readonly guildIdsToFetch: Set<string>

Defined in

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

Accessors

command

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

Returns

undefined | Command<Args, CommandOptions>

Defined in

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

Methods

addChatInputCommandIds

addChatInputCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addChatInputCommandNames

addChatInputCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandIds

addContextMenuCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandNames

addContextMenuCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


createMissingCommand

Private 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:437


debug

Private debug(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


error

Private error(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


handleAPICall

Private 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:225


handleCommandPresent

Private 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:331


info

Private info(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


logCommandDifferencesFound

Private logCommandDifferencesFound(applicationCommand, logAsWarn, differences): void

Parameters

NameType
applicationCommandApplicationCommand<{}>
logAsWarnboolean
differencesCommandDifference[]

Returns

void

Defined in

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


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


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


runAPICalls

Protected 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:189


trace

Private trace(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


warn

Private warn(message, ...other): void

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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