← Documentación  /  Guía del desarrollador

Crea un plugin

La referencia completa del SDK para desarrolladores de plugins — Python en sandbox, entregado como zip, distribuido a través del marketplace.

These docs are publicly viewable. To publish a plugin you'll need a free YourBot account: sign in to access the Dev Portal.
SDK v0.8.4

Los plugins son procesos Python en sandbox. Escribe un handler, declara tus capacidades, envía un zip — lo ejecutamos en un contenedor Docker restringido y transmitimos eventos de Discord mediante JSON-RPC.

¿Qué es un plugin?

Un plugin es un pequeño programa que escucha eventos en un servidor de Discord y reacciona a ellos.

  • Alguien se une a tu servidor → tu plugin envía un mensaje de bienvenida.
  • Alguien escribe /leaderboard → tu plugin responde con los 10 primeros usuarios.
  • Someone reacts to a message → your plugin counts the vote and updates the tally.

Tú escribes Python. Importas el SDK. Decoras una función con @plugin.on_event("member_join") y escribes lo que debería ocurrir. La plataforma se encarga del resto.

Lo que la plataforma hace por ti

  • Se conecta a Discord. Nunca tienes que lidiar con gateways WebSocket, sharding, intents ni límites de velocidad. La plataforma entrega los eventos a tus manejadores y convierte tus valores de retorno en llamadas a la API de Discord.
  • Aloja tu código. Sin servidores que alquilar, sin Docker que gestionar, sin despliegues a las 2 AM. Sube tu código — la plataforma lo ejecuta en un sandbox aislado.
  • 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.
  • Gestiona los pagos. Set a price or ship it free. 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.
  • Escala por ti. Una instalación o un millón — la plataforma gestiona la concurrencia, los reintentos y las cuotas.

Lo que tú haces

Escribir la lógica que convierte los eventos de Discord en acciones. Eso es todo. El flujo es el siguiente:

   ┌─────────────────┐     ┌──────────────────┐     ┌──────────────────┐     ┌──────────────────┐
   │  Discord event  │────▶│   YourBot       │────▶│  Your plugin's   │────▶│   YourBot       │
   │  (msg, /cmd…)   │     │   gateway        │     │   handler        │     │   sends to       │
   │                 │     │                  │     │                  │     │   Discord        │
   └─────────────────┘     └──────────────────┘     └──────────────────┘     └──────────────────┘
                                                              ▲
                                                              │
                                                    you write this part

En qué se diferencia un plugin de un "framework de bot de Discord"

AspectoPlugin (esta plataforma)Bot autoalojado (discord.py, etc.)
Conectarse a DiscordLa plataforma lo haceLo haces tú
Servidor para alojar el códigoLa plataforma lo proporcionaTú lo alquilas / gestionas
Pagos / StripeLa plataforma lo gestionaLo construyes tú mismo
Instalación por clienteUn clic para el clienteGuías a cada cliente a través de OAuth
Escalado / cuotas / reintentosLa plataforma lo gestionaTú lo gestionas
Reseñas / visibilidadMarketplace integradoTú promocionas tu bot por tu cuenta
Superficie de la API de DiscordControlada por capacidades (declara lo que necesitas)Acceso completo (tu responsabilidad)

Dónde invertirás tu tiempo

  1. Conectando eventos a controladores. Decoradores como @plugin.on_event("message_create") o @plugin.on_slash_command("hello").
  2. Almacenando estado. 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. (Opcional) Una página de configuración. Añade un manifiesto JSON y los clientes obtendrán una página del panel desde la que pueden configurar tu plugin. No se requiere código de frontend.

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 publish instantly. 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.

Good to know before you build

  • Your code has no direct network access. All HTTP goes through ctx.http to domains you declare; live connections go through ctx.ws.
  • Nothing persists on disk. Containers are wiped between restarts. Durable state belongs in ctx.kv or ctx.sql.
  • Resources are capped. 64 MB memory and a fraction of a vCPU per worker. The full numbers live in Limits and quotas.
  • Timers do not run on their own. Marketplace plugins are event-driven: periodic work rides on event traffic with a cooldown. See Pool mode.
  • Reading what people type is a privacy capability. Message text arrives empty unless you request events:message_content and the server approves it. See the capability catalog.
  • Your first version is reviewed by a human. Plan for a short wait before it goes live. See Publish & review.

Pregunta frecuente existente

Jump straight to the section that answers your question. The filter box above only searches the tab you are on.

I want to…Ve al
React when someone joins, posts or clicksTodos los eventos
comando de barraComandos de barra
Mensajes nuevosevents:message_content
Store per-server settings or countersAlmacén clave-valor
Keep an API key without hardcoding itUsuarios con acceso
Run real SQL queriesStorage & I/O: Sandboxed SQL
Call an external APISimular HTTP saliente
Hold a live connection to a game serverStorage & I/O: WebSockets
Do something on a scheduleProgramaciones cron
Ver configuraciónManifiesto del panel (JSON)
Test my plugin before uploadingPrimeros pasos
See what my plugin is allowed to touchReference: Capability catalog
Check every size and rate limitReference: Limits and quotas
Eliminar PluginNombra tu plugin
Publicar & revisarPublicar & revisar

SDK v0.8.4 · Última actualización: julio de 2026 · Volver al Portal de desarrolladores