Docs / Developers / What is a plugin? / What is a plugin?
UnderstandSDK 0.10.1

What is a plugin?

These docs are public. To publish a plugin you need a YourBot account: sign in to open the Dev Portal.

A plugin is a small program that listens to events in a Discord server and reacts to them.

  • Someone joins your server → your plugin sends a welcome message.
  • Someone types /leaderboard → your plugin replies with the top 10 users.
  • Someone reacts to a message → your plugin counts the vote and updates the tally.

You write Python. You import the SDK. You decorate a function with @plugin.on_event("member_join") and write what should happen. The platform handles the rest.

What the platform does for you

  • Connects to Discord. You never deal with WebSocket gateways, sharding, intents, or rate limits. The platform delivers events to your handlers, and one ctx.discord.send_message(…) call replies.
  • Hosts your code. No servers to rent, no Docker to manage, no deploys at 2 AM. Push your code — the platform runs it in an isolated sandbox.
  • Talks to the outside world. Call external APIs with ctx.http, hold live connections open with ctx.ws and let the platform inject API keys from encrypted secrets so your code never touches them. See Outbound HTTP.
  • Takes payments. Set a price or offer it at $0. Customers pay through Stripe and you keep 70–85% of revenue (tier depends on your last 30 days of volume), paid out to your bank automatically after a hold period. See Selling your plugin.
  • Gives every install a settings page. Declare a few widgets in JSON and admins get a themed dashboard page for your plugin — stat cards, charts, settings forms — without you writing a line of frontend. See Dashboards.
  • Ships your updates. Publish a new version and installs pick it up automatically (owners can pin a version to opt out). No migration emails, no "please re-invite the bot". See updates and rollback.
  • Scales for you. One install or one million — the platform handles concurrency, retries, quotas.

What you do

Write the logic that turns Discord events into actions. That's it. The flow looks like this:

Flow diagram: a Discord event such as a message or slash command goes to the YourBot gateway, then to your plugin's handler (the part you write), then YourBot sends the result back to Discord.

How a plugin is different from a "Discord bot framework"

ConcernPlugin (this platform)Self-hosted bot (discord.py, etc.)
Connect to DiscordPlatform does itYou do it
Server to host codePlatform providesYou rent / manage
Payments / StripePlatform handlesYou build it yourself
Per-customer installOne-click for customerYou walk each customer through OAuth
Scaling / quotas / retriesPlatform handlesYou handle it
Reviews / discoverabilityBuilt-in marketplaceYou market your bot yourself
Discord API surfaceCapability-gated (declare what you need)Full access (your responsibility)

Where you'll spend your time

  1. Wiring events to handlers. Decorators like @plugin.on_event("message_create") or @plugin.on_slash_command("hello").
  2. Storing state. Per-server settings, counters and leaderboards live in ctx.kv (key-value, every plugin has it) or ctx.sql (full SQL, a capability you request that is granted after staff review). Either way there is no database to manage.
  3. (Optional) A settings page. Drop in a JSON manifest and customers get a dashboard page they can configure your plugin from. No frontend code required.

You can build and submit your first plugin in an afternoon. New developers' first versions go through a short staff review before they appear in the marketplace; established developers publishing from public repos usually skip the queue. Click "Getting started" above when you're ready to write code. Prefer not to start from a blank file? The Plugin Builder writes a working first draft from a description, and the yourbot CLI runs it locally before you upload anything.

YourBot docs Reference tables are generated from the code that is running. Ask in Discord Suggest a correction