Overview
To build bots with this framework, here's the basic process.
- Initialize and configure
Dissonance
- Define some
CommandPlugins
- Register your
CommandPlugins
withDissonance
CommandPlugins
CommandPlugins
are abstract classes that you can extend that provide you with lifecycle methods to simplify command handling. By default, a CommandPlugin
can handle either message commands or application commands (slash commands).
Plugin Lifecycle
- attach
- start
- validateCommand
- parseArgs (required)
- validateArgs
- handle (required)
- cleanup
Run the example
Create a new Discord application, set up the bot, and invite it to your testing server. Set the following environment variables.
Variable | Description |
---|---|
DISCORD_TOKEN |
The bot token |
DISCORD_APPLICATION_ID |
The bot application's application id |
yarn
yarn example