Zrzur Bot API
A bot is a Zrzur account that a program controls. It sits in servers like a member, reads and sends messages, answers slash commands, shows buttons and forms, moderates, posts files and can join voice channels. People install it; your code runs on your own computer or server.
These pages are all you need. Start with Start your bot, then build the complete bot.
How a bot works
- You create an application in the Developer Portal. It comes with a bot user and a token, the password of the bot.
- Someone with Manage Server installs the bot in a server and gives it permissions.
- Your program calls the REST API over HTTPS with the token in the
x-bot-tokenheader. This is how a bot acts. - Your program keeps one gateway connection open, a WebSocket. This is how a bot hears: commands, button clicks, messages and member changes arrive there as events.
The path from nothing to a finished bot
- Start your bot: an application, a token, a first command.
- Applications and tokens: every setting of the Developer Portal, and how to install a bot.
- Gateway: connect, stay connected, come back after a failure.
- Slash commands, Answering interactions and Buttons, menus and forms.
- Messages, Roles and permissions, Moderation.
- Errors, Rate limits, Keeping tokens safe, Running in production.
Base URLs
| Service | URL |
|---|---|
| REST API | https://api.zrzur.com |
| Gateway (WebSocket) | wss://events.zrzur.com |
| Files | https://cdn.zrzur.com |
| Voice (LiveKit) | wss://voice.zrzur.com |
Self-hosted servers use their own addresses. GET / on the API returns them, with the limits of that server. Read these fields (the answer has more; this one is shortened):
{
"zrzur": "26.0.0",
"ws": "wss://events.zrzur.com",
"app": "https://app.zrzur.com",
"features": {
"autumn": { "enabled": true, "url": "https://cdn.zrzur.com" },
"january": { "enabled": true, "url": "https://api.zrzur.com/january" },
"livekit": {
"enabled": true,
"nodes": [{ "name": "fra", "lat": 50.11, "lon": 8.68, "public_url": "wss://voice.zrzur.com" }]
},
"webhooks": false,
"forwarding": false,
"polls": false,
"server_events": false,
"limits": {
"default": { "message_length": 2000, "message_attachments": 5, "file_upload_size_limits": { "attachments": 20000000 } }
}
}
}| Field | What it is |
|---|---|
zrzur | Version of the server; see the API changelog |
ws | Gateway address |
features.autumn.url | File server: uploads and downloads |
features.january.url | Media proxy for link previews |
features.livekit.nodes[].public_url | Voice server |
features.limits.default | Limits of an account, such as message length |
features.webhooks, features.forwarding, features.polls, features.server_events | Whether this installation has webhooks, message forwarding, polls and scheduled events switched on. Where one is false, its routes answer FeatureDisabled (webhook addresses: 404 NotFound) |
app | Web app, for links you show people |
GET /
Query Node. Fetch the server configuration for this Zrzur instance.
Rate limit: any_dlta, 20 / 10 s
What is not supported
- Sharding. One bot keeps one connection, or several connections that each receive everything. Events cannot be split between processes.
- Slash commands in groups, and server commands in direct messages. In a direct message with the bot, a person can use the bot's global commands that need no server permission. Buttons, selects and forms work there too.
- Webhooks, polls, forwarding and scheduled events where the installation has them switched off.
GET /says which are on; see Base URLs. - Interactions over HTTP on a server where the setting
signing_keyis empty. There the routes answerFeatureDisabled, and bots use the gateway. - Bots creating bots or servers, joining by invite, or having friends. People do those. The coverage page lists every endpoint bots are refused.
- The SDK as a package. It is not on npm yet. Every page here works with Node alone; see SDKs.
What each status means
Each endpoint in this reference shows one of these marks.
| Status | Endpoints |
|---|---|
supported | 101 |
partial | 4 |
unverified | 52 |
unsupported | 33 |