When creating plugins, you should avoid using Deno or Node specific features to make your plugin compatible with both the JSR and NPM package.
CLI Command
Terminal
Questions
The name of your plugin
A short description of what your plugin does
The name of your plugin
Files
Structure
Your plugin should have a similar structure to this.File Structure
Uses
/commands
Holds the commands for your plugin.
/events
Holds the events for your plugin.
Holds the manifest data and config for your plugin.
blitz.config.yaml
Theblitz.config.yaml
file contains all the metadata for your plugin. You can also add config valuese to this to allow users to customize your plugin.
Example blitz.config.yaml
blitz.config.yaml
Manifest Values
The name of your plugin
A short description of what your plugin does
The version of your plugin
Adding Config
You can add config values inside of your pluginsblitz.config.yaml
file which will be passed into your plugins commands and events.
blitz.config.yaml
cool_message
.
In any of the plugins commands or events you can access this.
Event.ts
This is a cool message
.
Commands
All commands for a plugin must go inside of the/commands
folder in the root of the plugin.
Commands are built using the discord.js SlashCommandBuilder class.
Example Command
ping.ts
Notice the import from
npm:discord.js
? This is a specific deno import which allows us to use discord.js within deno.Example Command (Config)
greet.ts
greetMsg
to your blitz.config.yaml
file.
blitz.config.yaml
Events
All events for a plugin must go inside of the/events
folder in the root of the plugin.
Example Event
ready.ts
Example Event (Config)
message.ts
message
to your blitz.config.yaml
file.
blitz.config.yaml
Test Plugin
You can test a plugin locally with one command.CLI Command
Terminal
CLI Params
Your bots token to test the plugin on