Bot platform: API, webhooks, and a Python SDK
Version 1.7.0 opens spaces up to their own bots: registration with tokens and access scopes, an API for reading and sending messages, signed webhooks, and a Python SDK.
Bots are often what keeps communities on a platform: a helpdesk bot collects requests, a music bot plays tracks in a voice channel, a utility bot posts repository notifications. With 1.7.0, Space gets a platform of its own for them.
How it works
- A bot is registered and gets a token with a limited set of permissions
- The space owner invites a bot just like a participant
- The Bot API lets it read and send messages and add reactions
- Webhooks are signed, so the receiver can verify the sender
- The space owner can see what the bot did, and request rates are limited
We also released a Python SDK: decorators for commands, an API client, and a webhook receiver. A simple bot fits in a few dozen lines.
What’s new in 1.8.0
- Slash commands
- A bot can reply to a command publicly in the channel — not just in a direct message.
- Bots in voice channels
- With their own name, avatar, a BOT badge, and the ability to play audio.
- Permissions in check
- A bot can’t go beyond the permissions it was given, and the platform throttles frequent requests on its own.
- See what a bot did
- Bot actions in a space are visible to the owner — no need to take anyone’s word for it.