Skip to main content

🪐 Command Deployer

The CommandDeployer is the object responsible for deploying commands. It's stored by a CommandManager, and you can get it via CommandManager#getDeployer().

You can't modify the repository directly since the CommandManager returns a ReadonlyCommandDeployer type, but the hidden methods are available at the CommandManager. This is because adding, removing and updating a command needs more logic than just modifying the repository, and the manager is responsible for coordinating this.

👷 Creation

You can create a command deployer by either:

  • Extending DefaultCommandDeployer from @framework (recommended).
  • Implementing the CommandDeployer interface from @core.
class MyCommandDeployer extends DefaultCommandDeployer {
// ...
}

const myBot = Bot.create((bot) => ({
commands: DefaultCommandManager.create(bot, client, clientBus, { deployer: myDeployer }),
}))