Five minutes to a running plugin. The whole local loop is four commands:
pip install yourbot-sdk
yourbot new my_plugin # scaffold from a template
cd my_plugin
yourbot dev # run locally, fire test events at your handlers
yourbot validate # the same checks the upload pipeline runs
Step by step:
1
Install the SDK:
pip install yourbot-sdk2
Scaffold a plugin with
yourbot new my_plugin (templates: basic, slash, welcome; skip cron — schedules don't run for marketplace plugins, see pool mode), or download the starter template.zip3
Edit
__main__.py, then check your work locally: yourbot validate runs the same checks as the upload pipeline and yourbot dev exercises your handlers without Docker.4
Zip the folder's contents (
manifest.json and __main__.py must sit at the zip root) and upload it on the Dev Portal, or link a GitHub repo and pull versions from it.5
Submit for review — published plugins appear on the Marketplace.
Hello, plugin
This whole file is a working plugin. Drop it in a folder with a manifest.json and ship it:
from yourbot_sdk import Plugin, Context
plugin = Plugin()
@plugin.on_ready
def ready(ctx: Context):
ctx.log("Plugin booted on server " + ctx.server_id)
@plugin.on_event("message_create")
def on_message(ctx: Context, event: dict):
if event.get("author_bot"):
return # ignore other bots
if "!ping" in event.get("content", ""):
ctx.discord.send_message(
channel_id=event["channel_id"],
content="Pong!",
)
# This is the entrypoint. Without it the plugin process exits immediately.
plugin.run()
Note: reading what people type (event["content"] on message_create / message_edit) requires the events:message_content capability. Without it those events are delivered meta-only: IDs and timestamps arrive, but content, author fields and attachments are omitted (so the author_bot check above needs the capability too). Slash commands don't need it.