Skip to main content

Module telegram

Module telegram 

Source
Expand description

Telegram messaging bridge โ€” long-polling getUpdates + REST send.

Lifecycle:

  1. TelegramBridge::init_global(config, http) โ€” call once at startup.
  2. The poll loop runs in a background tokio task (retries forever).
  3. TelegramBridge::get() returns the singleton for HTTP handler use.
  4. bridge.send(msg) enqueues a message for the REST client.
  5. bridge.health() returns the current connection status.

Modulesยง

poller ๐Ÿ”’
Telegram long-polling loop: getUpdates โ†’ dispatch โ†’ offset advance; outbound mpsc โ†’ REST send. Plays the same role as discord::gateway::run_gateway_loop, but with no session/resume state โ€” long polling has no connection to lose beyond a single HTTP request, so this is a plain retry-forever loop around one HTTP GET.
rest
Telegram Bot API REST client โ€” getUpdates long-polling plus sendMessage/editMessageText for outbound delivery.
types
Telegram Bot API wire types (getUpdates / sendMessage / editMessageText).

Structsยง

TelegramBridge
TelegramConfig

Staticsยง

GLOBAL_BRIDGE ๐Ÿ”’