Skip to main content

Crate wabot_addon_chat_controller_telegram

Crate wabot_addon_chat_controller_telegram 

Source
Expand description

Telegram chat channel — port of wabot-ts addon/chat-controller/telegram/TelegramChannel.ts. Built on teloxide.

Configuration is runtime-only: register a TelegramChannelConfig singleton with a bot token (typically read from BOT_TOKEN) and the channel will pick it up. The #[telegram] marker on a controller method takes no arguments — the framework resolves the channel and config from the container.

Why no inline-token decorator: the Rust macro can’t read environment state at compile time, and embedding tokens in source defeats secret hygiene. The runtime-config approach mirrors how the rest of wabot-rust handles per-channel state.

Structs§

TelegramChannel
Telegram channel. Cheap to clone (Arc-internal). Construct one per process and register as a singleton.
TelegramChannelConfig
Bot token + any future Telegram-specific knobs (admin chat ids, webhook URL, polling interval, etc.).

Constants§

TELEGRAM_CHANNEL_NAME