telega/message

Types

Messages represent the data that the bot receives from the Telegram API.

pub type Message {
  Message(kind: MessageKind, raw: RawMessage)
}

Constructors

  • Message(kind: MessageKind, raw: RawMessage)

    Arguments

    • raw

      Raw message data from the Telegram API.

pub type MessageKind {
  CommonMessage
  CommandMessage
  TextMessage
}

Constructors

  • CommonMessage
  • CommandMessage
  • TextMessage

Functions

pub fn decode(
  json: Dynamic,
) -> Result(Message, List(DecodeError))

Decode a message from the Telegram API.

Search Document