plugins/gateways/telegram/poller

Telegram poller — bot configuration and startup. Actual polling is handled by telega’s supervision tree (init_for_polling). This module provides bot config and the startup entry point.

Types

pub type Bot {
  Bot(token: String, name: String, persona_id: String)
}

Constructors

  • Bot(token: String, name: String, persona_id: String)
pub type Update {
  MessageUpdate(
    bot_name: String,
    chat_id: String,
    text: String,
    message_id: Int,
  )
  UnknownUpdate
}

Constructors

  • MessageUpdate(
      bot_name: String,
      chat_id: String,
      text: String,
      message_id: Int,
    )
  • UnknownUpdate

Values

pub fn default_bots() -> List(Bot)

Build a list of bots from configuration. Reads TELEGRAM_BOT_TOKEN from config/env. Returns an empty list if no token is configured.

pub fn start_polling(bots: List(Bot)) -> Nil

Start polling is now handled by telega.init_for_polling(). This function exists for backward compatibility.

Search Document