Skip to main content

clawdesk-channels

Concrete implementations of the Channel trait for each supported messaging platform. Each module implements Layer 0 (core) and relevant Layer 1 (capability) traits defined in clawdesk-channel.

Dependencies

Internal: clawdesk-types, clawdesk-channel

External: reqwest, tokio, serde, tracing, async-trait

Modules

ModuleDescriptionLayer 1 Traits
telegramTelegram Bot API integrationThreaded, Reactions, GroupManagement
discordDiscord bot via gateway + RESTThreaded, Reactions, GroupManagement, Streaming
slackSlack app via Web API + EventsThreaded, Reactions, GroupManagement, Directory
whatsappWhatsApp Business APIReactions
matrixMatrix protocol (Element)Threaded, Reactions, GroupManagement, Directory
cliLocal CLI channel (stdin/stdout)Streaming
desktopDesktop app channel (Tauri IPC)Streaming
webhookGeneric incoming/outgoing webhooks

Key Types

/// Telegram channel implementation
pub struct TelegramChannel {
bot_token: String,
client: reqwest::Client,
channel_id: ChannelId,
}

/// Discord channel implementation
pub struct DiscordChannel {
bot_token: String,
client: reqwest::Client,
gateway_url: String,
channel_id: ChannelId,
}

/// Slack channel implementation
pub struct SlackChannel {
bot_token: String,
client: reqwest::Client,
channel_id: ChannelId,
}

Channel Capability Matrix

ChannelSendReceiveThreadsReactionsGroupsStreamingDirectory
Telegram
Discord
Slack
WhatsApp
Matrix
CLI
Desktop

Configuration

[[channels]]
type = "telegram"
bot_token = "${TELEGRAM_BOT_TOKEN}"

[[channels]]
type = "discord"
bot_token = "${DISCORD_BOT_TOKEN}"

[[channels]]
type = "slack"
bot_token = "${SLACK_BOT_TOKEN}"
app_token = "${SLACK_APP_TOKEN}"

Example Usage

use clawdesk_channels::TelegramChannel;
use clawdesk_channel::Channel;

let telegram = TelegramChannel::new(TelegramConfig {
bot_token: std::env::var("TELEGRAM_BOT_TOKEN")?,
..Default::default()
});

// Register in the channel registry
registry.register(Box::new(telegram));
info

Each channel module handles platform-specific authentication, webhooks, and message format translation internally. The Channel trait provides a unified interface.