Plugin developer guide
Build, test, bundle, and publish ItsMyBot plugins.
ItsMyBot plugins are TypeScript packages that run inside the ItsMyBot runtime. A plugin can add slash commands, react to Discord events, expose typed server configuration, persist small amounts of data, and publish a marketplace presentation.
These docs are only for developers creating plugins.
Author lifecycle
- Create a plugin project that depends on
itsmybot. - Keep
src/index.tsas the bundler entrypoint. - Split metadata, config, commands, and events into focused files.
- Run
itsmybot bundle .to generate.itsmybot/manifest.jsonand.itsmybot/runtime.js. - Run
itsmybot publish .to upload the build. - Install the beta build in a test guild, then request stable review.
Install SDK
Use your package manager inside the plugin project:
pnpm add itsmybotWith npm:
npm install itsmybotAdd local scripts so bundle and publish commands are repeatable:
{
"scripts": {
"bundle": "itsmybot bundle .",
"publish": "itsmybot publish ."
},
"dependencies": {
"itsmybot": "latest"
}
}What a plugin exports
The bundler starts at src/index.ts. That file should export:
defaultConfig, when the plugin has server configuration.- a default plugin instance.
The plugin instance declares metadata, capabilities, commands, events, and optional storage:
import {
,
,
,
} from "itsmybot";
interface Config extends <string, unknown> {
: string;
}
class extends <Config> {
readonly = "welcome-helper";
readonly = "0.1.0";
readonly = "Welcome Helper";
readonly = "Send configurable welcome messages.";
readonly = .Engagements;
readonly = "2026-04-20";
readonly = [.DiscordInteractionReply] as ;
}
export default new ();Start here
- Project structure: choose files and ownership before the plugin grows.
- First plugin: build a typed command plugin end to end.
- Commands and events: add slash commands and Discord event handlers.
- Configuration: expose dashboard fields with JSDoc.
- Runtime rules: understand sandbox limits, actions, KV, and storage.
- Bundle and publish: generate artifacts and ship a beta.
Rules to keep in mind
- Plugin metadata lives in code; generated
.itsmybot/*files are build output. README.mdis the long marketplace presentation.summarystays short.- Declare every Discord write capability your plugin needs.
- Do not use Node-only APIs such as
fsorchild_processin runtime code. - Server validation runs again on publish; SDK validation is convenience, not source of truth.