telega

Types

pub opaque type Bot
pub type Chat {
  Chat(id: Int)
}

Constructors

  • Chat(id: Int)
pub type Handler =
  fn(Bot, Message) -> Result(Nil, Nil)
pub type Message {
  TextMessage(text: String, chat: Chat)
}

Constructors

  • TextMessage(text: String, chat: Chat)

Functions

pub fn add_handler(
  bot: Bot,
  handler: fn(Bot, Message) -> Result(Nil, Nil),
) -> Bot
pub fn bot_handler(
  bot: Bot,
  req: Request(Connection),
) -> Response(Body)
pub fn is_bot_request(bot: Bot, req: Request(Connection)) -> Bool
pub fn new(
  token token: String,
  url server_url: String,
  secret secret: String,
) -> Bot
pub fn reply(
  bot: Bot,
  message: Message,
  text: String,
) -> Result(Nil, Nil)
pub fn set_webhook(bot: Bot) -> Result(Bool, String)
Search Document