Class: ApplicationCommandRegistry
Constructors
new ApplicationCommandRegistry()
new ApplicationCommandRegistry(
commandName:string):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
commandName | string |
Returns
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:90
Properties
apiCalls
privatereadonlyapiCalls:InternalAPICall[] =[]
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:88
chatInputCommands
readonlychatInputCommands: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
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:41
commandName
readonlycommandName:string
The piece this registry is for.
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:35
contextMenuCommands
readonlycontextMenuCommands: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
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:47
globalChatInputCommandIds
readonlyglobalChatInputCommandIds:Set<string>
A set of all registered and valid global chat input command ids that point to this registry.
Source
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.
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:59
globalContextMenuCommandIds
readonlyglobalContextMenuCommandIds:Set<string>
A set of all registered and valid global context menu command ids that point to this registry.
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:69
guildCommandIds
readonlyguildCommandIds: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.
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:76
guildIdToChatInputCommandIds
readonlyguildIdToChatInputCommandIds: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.
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:81
guildIdToContextMenuCommandIds
readonlyguildIdToContextMenuCommandIds: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.
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:86
guildIdsToFetch
readonlyguildIdsToFetch:Set<string>
The guild ids that we need to fetch the commands for.
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:52
Accessors
command
getcommand():undefined|Command<Args,CommandOptions>
Returns
undefined | Command <Args, CommandOptions>
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:94
Methods
addChatInputCommandIds()
addChatInputCommandIds(...
commandIds:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...commandIds | string[] | string[][] |
Returns
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:206
addChatInputCommandNames()
addChatInputCommandNames(...
names:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...names | string[] | string[][] |
Returns
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:176
addContextMenuCommandIds()
addContextMenuCommandIds(...
commandIds:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...commandIds | string[] | string[][] |
Returns
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:227
addContextMenuCommandNames()
addContextMenuCommandNames(...
names:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...names | string[] | string[][] |
Returns
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:191
createMissingCommand()
privatecreateMissingCommand(commandsManager:ApplicationCommandManager<ApplicationCommand<object>,object,null>,apiData:RESTPostAPIChatInputApplicationCommandsJSONBody|RESTPostAPIContextMenuApplicationCommandsJSONBody,type:string,guildId?:string):Promise<void>
Parameters
| Parameter | Type |
|---|---|
commandsManager | ApplicationCommandManager <ApplicationCommand<object>, object, null> |
apiData | RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody |
type | string |
guildId? | string |
Returns
Promise<void>
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:530
debug()
privatedebug(message:string, ...other:unknown[]):void
Parameters
| Parameter | Type |
|---|---|
message | string |
...other | unknown[] |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:579
error()
privateerror(message:string, ...other:unknown[]):void
Parameters
| Parameter | Type |
|---|---|
message | string |
...other | unknown[] |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:571
getGuildIdsToRegister()
privategetGuildIdsToRegister(options?:RegisterOptions):undefined|string[]
Parameters
| Parameter | Type |
|---|---|
options? | RegisterOptions |
Returns
undefined | string[]
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:320
handleAPICall()
privatehandleAPICall(commandsManager:ApplicationCommandManager<ApplicationCommand<object>,object,null>,globalCommands:Collection<string,ApplicationCommand<object>>,allGuildsCommands:Map<string,Collection<string,ApplicationCommand<object>>>,apiCall:InternalAPICall):Promise<void>
Parameters
| Parameter | Type |
|---|---|
commandsManager | ApplicationCommandManager <ApplicationCommand<object>, object, null> |
globalCommands | Collection<string, ApplicationCommand<object>> |
allGuildsCommands | Map<string, Collection<string, ApplicationCommand<object>>> |
apiCall | InternalAPICall |
Returns
Promise<void>
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:341
handleCommandPresent()
privatehandleCommandPresent(applicationCommand:ApplicationCommand<object>,apiData:RESTPostAPIChatInputApplicationCommandsJSONBody|RESTPostAPIContextMenuApplicationCommandsJSONBody,behaviorIfNotEqual:RegisterBehavior,guildId:null|string):Promise<void>
Parameters
| Parameter | Type |
|---|---|
applicationCommand | ApplicationCommand<object> |
apiData | RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody |
behaviorIfNotEqual | RegisterBehavior |
guildId | null | string |
Returns
Promise<void>
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:430
handleIdAddition()
protectedhandleIdAddition(type:InternalRegistryAPIType,id:string,guildId?:null|string):void
Parameters
| Parameter | Type |
|---|---|
type | InternalRegistryAPIType |
id | string |
guildId? | null | string |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:284
info()
privateinfo(message:string, ...other:unknown[]):void
Parameters
| Parameter | Type |
|---|---|
message | string |
...other | unknown[] |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:567
logCommandDifferencesFound()
privatelogCommandDifferencesFound(applicationCommand:ApplicationCommand<object>,logAsWarn:boolean,differences:CommandDifference[]):void
Parameters
| Parameter | Type |
|---|---|
applicationCommand | ApplicationCommand<object> |
logAsWarn | boolean |
differences | CommandDifference[] |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:509
processGuildIds()
privateprocessGuildIds(guildIdsToRegister:undefined|string[]):void
Parameters
| Parameter | Type |
|---|---|
guildIdsToRegister | undefined | string[] |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:332
registerChatInputCommand()
registerChatInputCommand(
command:SlashCommandBuilder|SlashCommandOptionsOnlyBuilder|SlashCommandSubcommandsOnlyBuilder|ChatInputApplicationCommandData|Omit<SlashCommandBuilder,"addSubcommand"|"addSubcommandGroup"> | (builder:SlashCommandBuilder) =>unknown,options?:RegisterOptions):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
command | SlashCommandBuilder | SlashCommandOptionsOnlyBuilder | SlashCommandSubcommandsOnlyBuilder | ChatInputApplicationCommandData | Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup"> | (builder: SlashCommandBuilder) => unknown |
options? | RegisterOptions |
Returns
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:98
registerContextMenuCommand()
registerContextMenuCommand(
command:ContextMenuCommandBuilder|UserApplicationCommandData|MessageApplicationCommandData| (builder:ContextMenuCommandBuilder) =>unknown,options?:RegisterOptions):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
command | ContextMenuCommandBuilder | UserApplicationCommandData | MessageApplicationCommandData | (builder: ContextMenuCommandBuilder) => unknown |
options? | RegisterOptions |
Returns
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:138
runAPICalls()
protectedrunAPICalls(applicationCommands:ApplicationCommandManager<ApplicationCommand<object>,object,null>,globalCommands:Collection<string,ApplicationCommand<object>>,guildCommands:Map<string,Collection<string,ApplicationCommand<object>>>):Promise<void>
Parameters
| Parameter | Type |
|---|---|
applicationCommands | ApplicationCommandManager <ApplicationCommand<object>, object, null> |
globalCommands | Collection<string, ApplicationCommand<object>> |
guildCommands | Map<string, Collection<string, ApplicationCommand<object>>> |
Returns
Promise<void>
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:248
trace()
privatetrace(message:string, ...other:unknown[]):void
Parameters
| Parameter | Type |
|---|---|
message | string |
...other | unknown[] |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:583
warn()
privatewarn(message:string, ...other:unknown[]):void
Parameters
| Parameter | Type |
|---|---|
message | string |
...other | unknown[] |
Returns
void
Source
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:575