Messaging Adapters

Clawdius Gateway connects to messaging platforms through adapters -- pluggable modules that translate between each platform's API and Clawdius's internal message protocol.

Available Adapters

AdapterTransportFeature FlagStatus
TelegramLong-polling (teloxide)telegramStable
DiscordGateway (serenity)discordStable
SlackSocket Mode / Event APIslackStable
MatrixClient-Server sync (matrix-sdk)matrixStable
SignalREST API (signal-cli)--Stable
TeamsBot Framework REST API--Stable
WhatsAppMeta Cloud API--Stable
Rocket.ChatREST / Real-Time API--Stable
WebhookHTTP POST--Stable

Common Configuration Pattern

All adapters share the same PlatformConfig structure. Required fields are resolved from environment variables or the TOML config file:

[gateways.telegram]
api_token = "..."          # Maps to TELEGRAM_BOT_TOKEN
enabled = true

[gateways.telegram.settings]
# Adapter-specific key-value pairs

Each adapter reads api_token as its primary credential and uses the settings map for additional configuration.

Message Flow

Platform API --> Adapter --> Gateway (MessageHandler) --> LLM
                                                       |
Platform API <-- Adapter <-- Gateway (OutgoingMessage) <+

All adapters implement the PlatformAdapter trait which provides:

  • start() / stop() -- lifecycle management
  • send_message() -- deliver responses
  • edit_message() -- streaming edits (where supported)
  • download_attachment() -- file retrieval

Health Checking

Every adapter exposes a health() method returning:

FieldTypeDescription
healthyboolWhether the adapter is active
messagestringStatus summary (e.g. "polling", "syncing")
messages_processedu64Total messages handled
errorsu64Total errors encountered

Feature Gate Caveat

Telegram, Discord, Slack, and Matrix adapters are behind Cargo feature flags. Enable them at build time:

cargo build --features telegram,discord,slack,matrix

Signal, Teams, WhatsApp, Rocket.Chat, and Webhook adapters are always available.