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


addChatInputCommandNames

addChatInputCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandIds

addContextMenuCommandIds(...commandIds): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


addContextMenuCommandNames

addContextMenuCommandNames(...names): ApplicationCommandRegistry

Parameters

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

Returns

ApplicationCommandRegistry

Defined in

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


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


debug

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


error

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


getGuildIdsToRegister

Private getGuildIdsToRegister(options?): undefined | string[]

Parameters

NameType
options?RegisterOptions

Returns

undefined | string[]

Defined in

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


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


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


info

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


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


processGuildIds

Private processGuildIds(guildIdsToRegister): void

Parameters

NameType
guildIdsToRegisterundefined | string[]

Returns

void

Defined in

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


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


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


trace

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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


warn

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

Parameters

NameType
messagestring
...otherunknown[]

Returns

void

Defined in

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