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

Properties

apiCalls

Private Readonly apiCalls: InternalAPICall[] = []

Defined in

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


chatInputCommands

Readonly chatInputCommands: Set<string>

Defined in

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


commandName

Readonly commandName: string

Defined in

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


contextMenuCommands

Readonly contextMenuCommands: Set<string>

Defined in

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


guildIdsToFetch

Readonly guildIdsToFetch: Set<string>

Defined in

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

Accessors

command

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

Returns

undefined | Command<Args, CommandOptions>

Defined in

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

Methods

addChatInputCommandIds

addChatInputCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addChatInputCommandNames

addChatInputCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandIds

addContextMenuCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandNames

addContextMenuCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


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


debug

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


error

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


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


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


info

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


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


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


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


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


trace

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


warn

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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