telega/models/user

Types

pub type User {
  User(
    id: Int,
    is_bot: Bool,
    first_name: String,
    last_name: Option(String),
    username: Option(String),
    language_code: Option(String),
    is_premium: Option(Bool),
    added_to_attachment_menu: Option(Bool),
  )
}

Constructors

  • User(
      id: Int,
      is_bot: Bool,
      first_name: String,
      last_name: Option(String),
      username: Option(String),
      language_code: Option(String),
      is_premium: Option(Bool),
      added_to_attachment_menu: Option(Bool),
    )

    Official reference: https://core.telegram.org/bots/api#user

    Arguments

    • id

      Unique identifier for this user or bot.

    • first_name

      User’s or bot’s first name

    • last_name

      User’s or bot’s last name

    • username

      Username, for private chats, supergroups and channels if available

    • language_code

      IETF language tag of the user’s language

    • is_premium

      True, if this user is a Telegram Premium user

    • added_to_attachment_menu

      True, if this user added the bot to the attachment menu

Functions

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

Unique identifier for this user or bot. User’s or bot’s first name User’s or bot’s last name Username, for private chats, supergroups and channels if available IETF language tag of the user’s language True, if this user is a Telegram Premium user True, if this user added the bot to the attachment menu

pub fn encode(user: User) -> Json
Search Document