Repository
Reading time:1 min read
The CommandRepository is responsible for storing all the currently registered commands.
When to override
| ✅ Override if you want to... | ❌ Don't override if you want to... |
|---|---|
| Change how commands are stored. | Do something when commands are added, including decorating them. Use Command Events instead. |
| Change how commands are deployed. Override the CommandDeployer instead. |
Overriding
Creation
Create a custom command repository by either:
- Extending
DefaultCommandRepository(recommended, less work). - Implementing
CommandRepository.
import { } from '@nyx-discord/djs';
class extends {}Registration
Create it and set it to the CommandManager.
class extends {
/** Your overrides */
}
.().(.());The DefaultCommandRepository.create() method instantiates your custom repository, not the default one.
Edit on GitHub
Last updated on
