Class: ApplicationCommandRegistry
Constructors
new ApplicationCommandRegistry()
new ApplicationCommandRegistry(
commandName:string):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
commandName | string |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:90
Properties
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
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:41
commandName
readonlycommandName:string
The piece this registry is for.
Defined in
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
Defined in
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.
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
readonlyglobalContextMenuCommandIds: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
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.
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:76
guildIdsToFetch
readonlyguildIdsToFetch: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
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.
Defined in
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.
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:86
Accessors
command
Get Signature
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:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...commandIds | string[] | string[][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:206
addChatInputCommandNames()
addChatInputCommandNames(...
names:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...names | string[] | string[][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:176
addContextMenuCommandIds()
addContextMenuCommandIds(...
commandIds:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...commandIds | string[] | string[][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:227
addContextMenuCommandNames()
addContextMenuCommandNames(...
names:string[] |string[][]):ApplicationCommandRegistry
Parameters
| Parameter | Type |
|---|---|
...names | string[] | string[][] |
Returns
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:191
handleIdAddition()
protectedhandleIdAddition(type:InternalRegistryAPIType,id:string,guildId?:null|string):void
Parameters
| Parameter | Type |
|---|---|
type | InternalRegistryAPIType |
id | string |
guildId? | null | string |
Returns
void
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:284
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
Defined in
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
Defined in
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>
Defined in
projects/framework/src/lib/utils/application-commands/ApplicationCommandRegistry.ts:248