A Discord framework that upgrades your bot without rewriting it. Change one import line, get production-ready features instantly. Run anywhere — gateway or serverless.
import discord bot = discord.Client( intents=discord.Intents.default() ) @bot.command() async def ping(ctx): await ctx.send("Pong!") bot.run("TOKEN")
import sosad.compat as discord bot = discord.Bot( intents=discord.Intents.default() ) @bot.command(name="ping") async def ping(ctx): await ctx.send("Pong!") bot.run("TOKEN")
Just change the import. Everything else is automatic.
Per-route bucket tracking. Never see HTTP 429 again.
Typed exceptions, catch handlers, graceful recovery.
Auto-resolve from type annotations. No inject() needed.
Pipeline middleware, not before/after events.
Drop files in plugins/. Done.
@sosad.task(interval=300) — cron without the pain.
Build components dynamically, not with decorators.
Stateful views with timeout + built-in page navigation.
No WebSocket. Deploy to Workers, Fly.io, or Railway.
sosad init mybot — Gateway, REST, or Components template.
Every request logged with timing and context.
class Config(sosad.Settings) + auto .env loading.
Same code. Better backend.
| Feature | discord.py | SoSad |
|---|---|---|
| Rate Limiting | Manual | ✓ Auto |
| Error Handling | try/except | ✓ Pipeline |
| Dependency Injection | None | ✓ FastAPI-style |
| Middleware | Before/After | ✓ ASGI Pipeline |
| Plugins | Manual load | ✓ Auto-discover |
| Background Tasks | Manual asyncio | ✓ @task() |
| Persistent Views | Built-in | ✓ PersistentView |
| Paginator | 3rd party | ✓ Built-in |
| REST / Serverless | No | ✓ RestBot |
| CLI Scaffold | — | ✓ sosad init |
| Type Safety | Partial | ✓ Full strict |
| Config | Manual .env | ✓ Settings class |