Supported Platforms
Discord
Discord servers with full support for threads, embeds, buttons, and polls
Slack
Slack workspaces with Block Kit, slash commands, and ephemeral messages
Telegram
Telegram groups and DMs with media attachments and inline keyboards
Twitch
Twitch chat integration with trigger prefixes and user filtering
IMAP/SMTP email with threading support and attachment handling
Architecture
Each messaging adapter runs independently with its own connection lifecycle:- Discord uses Serenity with Gateway events and full cache
- Slack uses Socket Mode for real-time events without webhooks
- Telegram uses long polling via the Bot API
- Twitch connects via IRC with OAuth token refresh
- Email polls IMAP folders and sends via SMTP
Messaging trait with consistent APIs for sending messages, handling status updates, streaming responses, and fetching history.
Features
Message Types
Every adapter supports:- Plain text with automatic length-aware chunking
- File attachments (images, documents, any mime type)
- Reactions (emoji reactions on messages)
- Threading (conversation isolation in threads)
- Status indicators (typing/thinking indicators while processing)
Platform-Specific Features
Discord
Discord
- Rich embeds with fields, colors, and footers
- Interactive buttons (primary, secondary, success, danger, link)
- Select menus with custom options
- Polls with multiple answers and multiselect
- Thread creation with automatic fallback to regular messages
- Message history backfill (up to 100 messages)
Slack
Slack
- Block Kit messages with sections, dividers, and actions
- Slash commands routed to specific agents
- Ephemeral messages (visible only to triggering user)
- Scheduled messages via
chat.scheduleMessage - Streaming responses via message edits
- User and channel metadata resolution
Telegram
Telegram
- Markdown formatting (bold, italic, code)
- Inline keyboards with callback buttons
- File downloads via authenticated URLs
- Chat action indicators (typing, uploading)
- Poll creation with quiz mode support
- Group and private chat filtering
Twitch
Twitch
- Trigger prefix filtering (e.g.,
!ask) - User allowlist for access control
- Channel-specific agent routing
- Automatic OAuth token refresh
- Rate limit handling (20 msg/30s, 100 for mods)
Email
- Thread detection via References and In-Reply-To headers
- HTML email rendering with automatic text conversion
- Multi-folder polling (INBOX, custom folders)
- Attachment size limits and filtering
- Sender allowlist with domain wildcards
- Auto-generated email filtering (no bounce/autoreply processing)
Message Coalescing
Spacebot includes a message coalescing system that detects rapid-fire message bursts and batches them into a single LLM turn. This prevents the agent from responding to every individual message in a fast-moving channel.How it works: When messages arrive within a configurable debounce window (default 2 seconds), they’re grouped together. The LLM receives all messages in the batch and can choose to respond to the most interesting one, address multiple points, or stay quiet.
Bindings
Bindings connect conversations to agents. Each binding maps a platform conversation to a specific agent ID.config.toml
Permissions and Filtering
All adapters support hot-reloadable permission filtering:- Guild/Workspace filter — only respond in specific servers or workspaces
- Channel filter — only respond in specific channels
- DM allowlist — only accept DMs from specific user IDs
- User allowlist (Twitch, Email) — restrict who can interact
Streaming Responses
Adapters that support message editing can stream LLM responses word-by-word:- Discord — edits a placeholder message with incremental content
- Slack — edits via
chat.updatewith rate-limit-aware throttling - Telegram — edits with 1-second minimum interval to avoid rate limits
Multi-Instance Support
You can run multiple instances of the same platform adapter with different credentials:config.toml
Next Steps
Discord Setup
Create a bot and connect to your server
Slack Setup
Configure Socket Mode and app tokens
Telegram Setup
Get a bot token from BotFather
Twitch Setup
Set up OAuth and join channels
Email Setup
Configure IMAP polling and SMTP delivery
Configuration Reference
Full messaging config options