bostie¶
bostie ist eine Discord-Bibliothek für Python, deren Gateway, HTTP-Client und Sprach-Engine in Rust laufen. Den Bot selbst schreibst du in typisiertem, asynchronem Python.

Pre-Alpha
Die API von bostie kann sich noch ändern. Slash-, Benutzer- und Nachrichtenbefehle, Komponenten, Modals, Gateway-Events, der Cache, REST, Webhooks, HTTP-Interaktionen, OAuth2 sowie Wiedergabe und Empfang in Sprachkanälen funktionieren schon heute.
import bostie
from bostie import ComponentContext, Context, ui, voice
bot = bostie.Bot()
@bot.command
async def play(ctx: Context, url: str) -> None:
"""Play a direct media URL in your voice channel."""
vc = ctx.voice.current or await ctx.voice.connect()
await vc.play(voice.Url(url))
stop = ui.button("Stop", custom_id=stop_playing.id(guild_id=vc.guild_id))
await ctx.respond(components=[ui.text(f"Playing <{url}>"), ui.row(stop)])
@bot.on_component("stop:{guild_id:int}")
async def stop_playing(ctx: ComponentContext, guild_id: int) -> None:
if (vc := bot.voice.get(guild_id)) is not None:
vc.stop()
await ctx.update(components=[ui.text("Stopped.")])
bot.run()
/play tritt dem Sprachkanal des Benutzers bei, der den Befehl ausgeführt hat, streamt die URL und antwortet mit einem Stopp-Button. Die Custom-ID des Buttons trägt die Server-ID, und @bot.on_component liest sie wieder als int aus. Deshalb funktioniert der Button auch nach einem Neustart des Bots. bot.run() liest das Token aus der Umgebungsvariable BOSTIE_TOKEN und sendet den Befehl an Discord, wenn er sich geändert hat.
Nutzt du einen KI-Coding-Assistenten?
Installiere den bostie-Skill, damit dein Coding-Assistent bostie-Aufgaben besser löst. Kopiere den Prompt und füge ihn in deinen Coding-Assistenten ein. Mehr über den Skill
Den bostie-Skill installieren
Install the bostie skill for my coding agent so it writes correct bostie code: Discord bots with slash commands, components, events, REST calls, voice and tests.
Use the Agent Skills installer with the bostie repository, https://github.com/nicokim/bostie:
npx skills add nicokim/bostie --skill bostie --yes
If I ask for a global install instead, use:
npx skills add nicokim/bostie --skill bostie --yes --global
Detect which agent or editor I am using. If it is one of these and I prefer the plugin path, install the bostie plugin instead, as https://bostie.dev/de/assistants/ shows:
Claude Code: /plugin marketplace add nicokim/bostie, then /plugin install bostie@bostie
Codex CLI: codex plugin marketplace add nicokim/bostie, then codex plugin add bostie@bostie
GitHub Copilot CLI: copilot plugin marketplace add nicokim/bostie, then copilot plugin install bostie@bostie
VS Code with GitHub Copilot: run "Chat: Install Plugin from Source" and enter nicokim/bostie
Devin: devin plugins install nicokim/bostie#docs
Factory Droid: droid plugin marketplace add nicokim/bostie, then droid plugin install bostie@bostie --scope user
Qwen Code: qwen extensions install nicokim/bostie:bostie
Do not invent other skill names or install URLs.
Then add this line to the instructions file you read at the start of every session (AGENTS.md at the project root, or your global one for a global install), and create the file if needed:
Before you write or change code that uses bostie, look at how the project is laid out, then load the bostie skill.
After installing, confirm that the bostie skill is available to you.
Wofür es gebaut ist¶
Sprachkanäle¶
Seit dem 1. März 2026 akzeptiert Discord nur noch Ende-zu-Ende-verschlüsselte Anrufe (DAVE). Die Sprach-Engine von bostie läuft auf Rust-Threads, außerhalb des GIL: der 20-ms-Takt, das Dekodieren, das Mischen, die Opus-Kodierung, die Transportverschlüsselung und DAVE. Python muss nur den Puffer jedes Sinks gefüllt halten, standardmäßig 0,2 Sekunden Audio. bostie spielt Dateien, URLs, HLS-Streams und dein eigenes PCM oder Opus ab, mischt mehrere Quellen, empfängt jeden Sprecher einzeln und nimmt Anrufe auf.
Bots, die Discords Änderungen überstehen¶
Unbekannte Felder, Enum-Werte, Komponententypen und Interaktionstypen bringen das Dekodieren nie zum Scheitern. Jedes Event und jedes Modell, das aus einem vollständigen Payload dekodiert wird, behält das rohe JSON, und mit bot.http und Roh-Event-Listenern erreichst du alles, was bostie noch nicht modelliert.
Typen, die zu Discords Dokumentation passen¶
Ein Feld, das Discord immer sendet, ist nie None, und ein partielles Objekt hat eine eigene Klasse: Ein Mitglied, das aus einer Befehlsoption aufgelöst wird, ist ein ResolvedMember und hat weder deaf noch mute.
Befehle aus Signaturen¶
Optionen, Auswahlmöglichkeiten, Wertebereiche und Autovervollständigung ergeben sich aus den Type Hints. Namen, Beschreibungen, die Anzahl der Optionen und die Auswahlmöglichkeiten werden schon beim Ausführen des Decorators gegen Discords Limits geprüft, nicht erst, wenn Discord die Synchronisierung ablehnt.
Tests ohne Discord¶
bostie.testing.FakeDiscord ist ein lokales Gateway samt REST-API, gegen das du deinen echten Bot laufen lässt.
Wie es weitergeht¶
- Installiere bostie und seine Build-Voraussetzungen.
- Schreib im Schnellstart einen ersten Bot.
- Die Anleitungen erklären je eine Funktion pro Seite, von Slash-Befehlen bis zum Testen.
- Der Abschnitt Sprachkanäle behandelt Verbindungen, Wiedergabe, rohes Audio und Empfang.
- Die Referenz listet jede
Bot-Option, jedes Event und die API auf.