Quick Start
How it works
UnifiedDelivery (via create_delivery(bot)) reads platform_capabilities to chunk long replies, stream edits, and apply rate limits.
Configuration options
| Field | Type | Default | Description |
|---|---|---|---|
max_message_length | int | 4096 | Maximum message length in the platform’s unit |
length_unit | str | "codepoints" | "codepoints" or "utf16" |
supports_edit | bool | False | In-place message edits (streaming) |
supports_typing | bool | True | Typing indicators |
markdown_dialect | str | "markdown" | e.g. "telegram_markdown_v2", "discord_markdown" |
needs_rate_limit | bool | True | Apply Praison rate limiting |
edit_interval_ms | int | 1000 | Minimum ms between edits |
max_files_per_message | int | 1 | Attachments per message |
max_file_size_mb | int | 10 | Max file size in MB |
supported_file_types | List[str] | ["*"] | Allowed mime types or extensions |
to_dict() and from_dict(data).
Built-in platform defaults
| Platform | Notes |
|---|---|
| Telegram | max_message_length=4096, length_unit="utf16", supports_edit=True, markdown_dialect="telegram_markdown_v2", needs_rate_limit=True, edit_interval_ms=1000, max_file_size_mb=50 |
| Discord | max_message_length=2000, length_unit="codepoints", supports_edit=True, needs_rate_limit=False, edit_interval_ms=500, max_files_per_message=10, max_file_size_mb=8 |
| slack, whatsapp, linear, email, agentmail | Uses PlatformCapabilities() defaults until the adapter declares its own |
Common patterns
Subclass withdefault_capabilities() (Telegram and Discord use this):
Best practices
Use utf16 for Telegram
Use utf16 for Telegram
Telegram counts UTF-16 code units. Wrong
length_unit can silently truncate messages.Set needs_rate_limit=False only when the SDK rate-limits
Set needs_rate_limit=False only when the SDK rate-limits
Discord.py handles limits internally; raw Telegram HTTP does not.
Enable supports_edit only with edit_message()
Enable supports_edit only with edit_message()
UnifiedDelivery streams via edits when this flag is true.Prefer default_capabilities() on the adapter class
Prefer default_capabilities() on the adapter class
Keeps registry caching consistent when platforms override defaults.
Related
Bot Platform Plugins
Register custom adapters
Bot Streaming Replies
Uses supports_edit and edit_interval_ms
Bot Rate Limiting
Uses needs_rate_limit
Chunking Strategies
Uses max_message_length and length_unit

