Bot API guide
After creating an application and bot token in the portal, you can use the REST API, event gateway, and voice join flow to connect your bot.
Command flow
Bots can sync slash commands with option schemas; the desktop client surfaces them in autocomplete and sends the selected command through the interaction endpoint as an APPLICATION_COMMAND event.
PUT ${API_ORIGIN}/api/bot/v1/commands
{
"commands": [
{
"name": "play",
"description": "Play a track in voice",
"options": [
{ "name": "url", "description": "Track URL", "type": "string", "required": true }
]
}
]
}
POST ${API_ORIGIN}/api/channels/{channelId}/interactions/commands
{
"commandId": "<registered-command-id>",
"rawInput": "/play https://example.com/audio.mp3"
}REST flow
Use the bot token to list servers, inspect channels, send messages, and trigger typing.
curl -H "Authorization: Bearer <bot-token>" \
{API_ORIGIN}/api/bot/v1/serversGateway flow
The WebSocket connection starts with HELLO, IDENTIFY, and HEARTBEAT frames; message and voice events arrive as DISPATCH payloads.
const socket = new WebSocket("${GATEWAY_ORIGIN}/gateway/bot");
socket.onmessage = (event) => console.log(JSON.parse(event.data));Voice flow
The bot requests a LiveKit token from the voice join endpoint and then connects to the voice room with the same identity to publish audio.
POST /api/bot/v1/channels/{channelId}/voice/join
=> { token, url, channelId, participants }