Class: ApplicationCommandRegistry
Constructors
constructor
• new ApplicationCommandRegistry(commandName
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
commandName | string |
Returns
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
Name | Type |
---|---|
...commandIds | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:206
addChatInputCommandNames
▸ addChatInputCommandNames(...names
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
...names | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:176
addContextMenuCommandIds
▸ addContextMenuCommandIds(...commandIds
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
...commandIds | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:227
addContextMenuCommandNames
▸ addContextMenuCommandNames(...names
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
...names | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:191
createMissingCommand
▸ createMissingCommand(commandsManager
, apiData
, type
, guildId?
): Promise
<void
>
Parameters
Name | Type |
---|---|
commandsManager | ApplicationCommandManager <ApplicationCommand <{ guild : GuildResolvable }>, { guild : GuildResolvable }, null > |
apiData | RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody |
type | string |
guildId? | string |
Returns
Promise
<void
>
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:530
debug
▸ debug(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:579
error
▸ error(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:571
getGuildIdsToRegister
▸ getGuildIdsToRegister(options?
): undefined
| string
[]
Parameters
Name | Type |
---|---|
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
Name | Type |
---|---|
commandsManager | ApplicationCommandManager <ApplicationCommand <{ guild : GuildResolvable }>, { guild : GuildResolvable }, null > |
globalCommands | Collection <string , ApplicationCommand <>> |
allGuildsCommands | Map <string , Collection <string , ApplicationCommand <>>> |
apiCall | InternalAPICall |
Returns
Promise
<void
>
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:341
handleCommandPresent
▸ handleCommandPresent(applicationCommand
, apiData
, behaviorIfNotEqual
, guildId
): Promise
<void
>
Parameters
Name | Type |
---|---|
applicationCommand | ApplicationCommand <> |
apiData | RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody |
behaviorIfNotEqual | RegisterBehavior |
guildId | null | string |
Returns
Promise
<void
>
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:430
handleIdAddition
▸ handleIdAddition(type
, id
, guildId?
): void
Parameters
Name | Type |
---|---|
type | InternalRegistryAPIType |
id | string |
guildId? | null | string |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:284
info
▸ info(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:567
logCommandDifferencesFound
▸ logCommandDifferencesFound(applicationCommand
, logAsWarn
, differences
): void
Parameters
Name | Type |
---|---|
applicationCommand | ApplicationCommand <> |
logAsWarn | boolean |
differences | CommandDifference [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:509
processGuildIds
▸ processGuildIds(guildIdsToRegister
): void
Parameters
Name | Type |
---|---|
guildIdsToRegister | undefined | string [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:332
registerChatInputCommand
▸ registerChatInputCommand(command
, options?
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
command | SlashCommandBuilder | SlashCommandSubcommandsOnlyBuilder | SlashCommandOptionsOnlyBuilder | ChatInputApplicationCommandData | Omit <SlashCommandBuilder , "addSubcommand" | "addSubcommandGroup" > | (builder : SlashCommandBuilder ) => unknown |
options? | RegisterOptions |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:98
registerContextMenuCommand
▸ registerContextMenuCommand(command
, options?
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
command | ContextMenuCommandBuilder | UserApplicationCommandData | MessageApplicationCommandData | (builder : ContextMenuCommandBuilder ) => unknown |
options? | RegisterOptions |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:138
runAPICalls
▸ runAPICalls(applicationCommands
, globalCommands
, guildCommands
): Promise
<void
>
Parameters
Name | Type |
---|---|
applicationCommands | ApplicationCommandManager <ApplicationCommand <{ guild : GuildResolvable }>, { guild : GuildResolvable }, null > |
globalCommands | Collection <string , ApplicationCommand <>> |
guildCommands | Map <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
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:583
warn
▸ warn(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:575