️🔀 Command Resolver
The CommandResolver
is the object responsible for figuring to what command an ApplicationCommandInteraction
or an
AutocompleteInteraction
is trying to call. It's stored by a CommandManager
, and you can get it
via CommandManager#getResolver()
.
👷 Creation
You can create a command resolver by either:
- Extending
DefaultCommandResolver
from@framework
(recommended). - Implementing the
CommandResolver
interface from@core
.
- Extending DefaultCommandResolver
- Implementing CommandResolver
class MyCommandResolver extends DefaultCommandResolver {
// ...
}
const myResolver = new MyCommandResolver();
const myBot = Bot.create((bot) => ({
commands: DefaultCommandManager.create(bot, client, clientBus, { resolver: myResolver }),
}));
class MyCommandResolver implements CommandResolver {
// ...
}
const myResolver = new MyCommandResolver();
const myBot = Bot.create((bot) => ({
commands: DefaultCommandManager.create(bot, client, clientBus, { resolver: myResolver }),
}));