Class: ApplicationCommandRegistry
Constructors
constructor
• new ApplicationCommandRegistry(commandName
)
Parameters
Name | Type |
---|---|
commandName | string |
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
Name | Type |
---|---|
...commandIds | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:147
addChatInputCommandNames
▸ addChatInputCommandNames(...names
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
...names | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:117
addContextMenuCommandIds
▸ addContextMenuCommandIds(...commandIds
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
...commandIds | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:168
addContextMenuCommandNames
▸ addContextMenuCommandNames(...names
): ApplicationCommandRegistry
Parameters
Name | Type |
---|---|
...names | string [] | string [][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:132
createMissingCommand
▸ Private
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:437
debug
▸ Private
debug(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:490
error
▸ Private
error(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:482
handleAPICall
▸ Private
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:225
handleCommandPresent
▸ Private
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:331
info
▸ Private
info(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:478
logCommandDifferencesFound
▸ Private
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:416
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:47
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:83
runAPICalls
▸ Protected
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:189
trace
▸ Private
trace(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:494
warn
▸ Private
warn(message
, ...other
): void
Parameters
Name | Type |
---|---|
message | string |
...other | unknown [] |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:486