Class: CommandManager
Constructors
constructor
• new CommandManager(app
, baseCommands
)
Parameters
Name | Type |
---|---|
app | App |
baseCommands | Command [] |
Defined in
packages/disploy/src/commands/CommandManager.ts:18
Properties
app
• Private
app: App
Defined in
packages/disploy/src/commands/CommandManager.ts:18
commands
• Private
Readonly
commands: Map
<string
, Command
>
Defined in
packages/disploy/src/commands/CommandManager.ts:16
Methods
areSlashCommandsEqual
▸ Private
areSlashCommandsEqual(command
, existingCommand
): boolean
Parameters
Name | Type |
---|---|
command | ChatInputCommand |
existingCommand | APIApplicationCommand |
Returns
boolean
Defined in
packages/disploy/src/commands/CommandManager.ts:149
filterExistingCommands
▸ Private
filterExistingCommands(existingCommands
): [Command
, APIApplicationCommand
][]
Parameters
Name | Type |
---|---|
existingCommands | RESTGetAPIApplicationCommandsResult |
Returns
[Command
, APIApplicationCommand
][]
Defined in
packages/disploy/src/commands/CommandManager.ts:101
filterNonFrameworkCommands
▸ Private
filterNonFrameworkCommands(existingCommands
): Command
[]
Parameters
Name | Type |
---|---|
existingCommands | RESTGetAPIApplicationCommandsResult |
Returns
Command
[]
Defined in
packages/disploy/src/commands/CommandManager.ts:119
getCommands
▸ getCommands(): Map
<string
, Command
>
Get the locally registered commands in this manager
Returns
Map
<string
, Command
>
Registered commands in this manager
Defined in
packages/disploy/src/commands/CommandManager.ts:28
getRegisteredCommands
▸ getRegisteredCommands(options?
): Promise
<RESTGetAPIApplicationCommandsResult
>
Get all registered command on the DAPI for this application
Parameters
Name | Type | Description |
---|---|---|
options? | Object | Options for the request |
options.guildId? | string | - |
options.onlyFramework? | boolean | - |
Returns
Promise
<RESTGetAPIApplicationCommandsResult
>
Registered commands for this application on Discord
Defined in
packages/disploy/src/commands/CommandManager.ts:84
registerCommand
▸ registerCommand(command
): void
Parameters
Name | Type |
---|---|
command | Command |
Returns
void
Defined in
packages/disploy/src/commands/CommandManager.ts:32
registerCommandToDiscord
▸ Private
registerCommandToDiscord(command
, guildId?
): Promise
<void
>
Parameters
Name | Type |
---|---|
command | Command |
guildId? | string |
Returns
Promise
<void
>
Defined in
packages/disploy/src/commands/CommandManager.ts:123
syncCommands
▸ syncCommands(merge?
, guildId?
): Promise
<void
>
Sync all registered commands with the DAPI
Parameters
Name | Type | Default value | Description |
---|---|---|---|
merge | boolean | true | - |
guildId? | string | undefined | Guild ID to sync commands for |
Returns
Promise
<void
>
Defined in
packages/disploy/src/commands/CommandManager.ts:43
updateCommandOnDiscord
▸ Private
updateCommandOnDiscord(id
, command
, guildId?
): Promise
<void
>
Parameters
Name | Type |
---|---|
id | string |
command | Command |
guildId? | string |
Returns
Promise
<void
>
Defined in
packages/disploy/src/commands/CommandManager.ts:136