Deployer
Deploys commands and stores the ApplicationCommand mappings
Reading time:1 min read
The CommandDeployer is responsible for deploying commands to Discord and storing the ApplicationCommand mappings.
When to override
| ✅ Override if you want to... | ❌ Don't override if you want to... |
|---|---|
| Deploy commands in a different way. | Change command serialization. That is done in the command itself, you can override your data property or getData() method instead. |
Deploy commands conditionally or manually. Instead, return deployCommands: false on Bot.create() and call CommandManager#deploy() when you want. |
Overriding
Creation
Create a custom deployer by either:
- Extending
DefaultCommandDeployer(recommended, less work). - Implementing
CommandDeployer.
import { } from '@nyx-discord/djs';
class extends {}Registration
Create it and set it to the CommandManager.
class extends {
/** Your overrides */
}
.().(.());The DefaultCommandDeployer.create() method instantiates your custom deployer, not the default one.
Edit on GitHub
Last updated on
