telega/api

Types

pub type ApiResponse(result) {
  ApiResponse(ok: Bool, result: result)
}

Constructors

  • ApiResponse(ok: Bool, result: result)

Functions

pub fn delete_my_commands(
  token token: String,
  parameters parameters: Option(BotCommandParameters),
) -> Result(Bool, String)

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

pub fn get_my_commands(
  token token: String,
  parameters parameters: Option(BotCommandParameters),
) -> Result(List(BotCommand), String)

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

pub fn send_dice(
  token token: String,
  chat_id chat_id: Int,
  parameters parameters: Option(SendDiceParameters),
) -> Result(Message, String)

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

pub fn send_message(
  token token: String,
  chat_id chat_id: Int,
  text text: String,
) -> Result(Message, String)

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

pub fn set_my_commands(
  token token: String,
  commands commands: List(BotCommand),
  parameters parameters: Option(BotCommandParameters),
) -> Result(Bool, String)

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

pub fn set_webhook(
  token token: String,
  webhook_url webhook_url: String,
  secret_token secret_token: Option(String),
) -> Result(Bool, String)

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

Search Document