telegram-bot

MoonBit Telegram Bot API library with async support

telegram
bot
api
async
moon add tonyfettes/telegram-bot@0.1.0
Download zip
Version
0.1.0
License
Apache-2.0
Last updated
5 months ago
Downloads
17

Dependencies

README

#telegram-bot

MoonBit Telegram Bot API library with async support.

#Installation

moon add tonyfettes/telegram-bot

#Quick Start

async fn main {
guard @sys.get_env_var("TELEGRAM_BOT_TOKEN") is Some(token) else {
fail("Error: TELEGRAM_BOT_TOKEN environment variable is not set")
}
let bot = @bot.Bot::new(token~)
let mut offset = 0
while true {
let updates = bot.get_updates(offset~, timeout=30) catch {
error => {
println("Error getting updates: \{error}")
continue
}
}
for update in updates {
offset = update.update_id + 1
if update.message is Some(msg) && msg.text is Some(text) {
try bot.send_message(chat_id=msg.chat.id, text~) |> ignore() catch {
error => println("Error sending message: \{error}")
}
}
}
}
}

#Features

  • 106 async API methods covering the Telegram Bot API
  • Typed structs for all Telegram types (users, chats, messages, media, inline queries, payments, etc.)
  • JSON serialization/deserialization for all types
  • Structured error handling via TelegramError

#API Overview

The library wraps Telegram Bot API methods as async functions on the Bot struct. Each method accepts named parameters and returns typed results.

// Send a text message
bot.send_message(chat_id=123456L, text="Hello!") |> ignore()

// Send a photo
bot.send_photo(chat_id=123456L, photo="https://example.com/photo.jpg") |> ignore()

// Get bot info
let me = bot.get_me()

// Edit a message
bot.edit_message_text(chat_id=123456L, message_id=42, text="Updated!") |> ignore()

Methods are organized into groups: messages, media, chat management, inline queries, payments, stickers, forum topics, games, and more.

#Error Handling

All API methods raise TelegramError, which covers:

  • HttpError -- HTTP request failures
  • ApiError -- Telegram API errors (invalid token, permission denied, etc.)
  • InvalidUtf8 / InvalidJson -- Response decoding failures
  • InvalidResponse / InvalidResult -- Unexpected response structure
  • ParseError -- Generic parsing errors

#License

Apache-2.0

#
TelegramError

pub(all) suberror TelegramError {
HttpError(Int, String)
ApiError(Int, String)
InvalidUtf8(
Malformed
)
InvalidJson(
ParseError
)
InvalidResponse(Json)
InvalidResult(Json,
JsonDecodeError
)
ParseError(String)
}

Error type for Telegram Bot API operations, covering HTTP, API, UTF-8, JSON, and parse failures.

#
AcceptedGiftTypes

pub struct AcceptedGiftTypes {
unlimited_gifts : Bool
limited_gifts : Bool
unique_gifts : Bool
premium_subscription : Bool
}

Describes the types of gifts that can be sent or received by a user or chat.

#
AcceptedGiftTypes::new

fn AcceptedGiftTypes::new(unlimited_gifts~ : Bool, limited_gifts~ : Bool, unique_gifts~ : Bool, premium_subscription~ : Bool) -> AcceptedGiftTypes

Creates a new [AcceptedGiftTypes].

#
Animation

pub struct Animation {
file_id : String
file_unique_id : String
width : Int
height : Int
duration : Int
thumbnail : PhotoSize?
file_name : String?
mime_type : String?
file_size : Int64?
}

Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
impl Eq for Animation
impl Show for Animation
impl ToJson for Animation

#
Animation::new

fn Animation::new(file_id~ : String, file_unique_id~ : String, width~ : Int, height~ : Int, duration~ : Int, thumbnail? : PhotoSize, file_name? : String, mime_type? : String, file_size? : Int64) -> Animation

Creates a new [Animation].

#
Audio

pub struct Audio {
file_id : String
file_unique_id : String
duration : Int
performer : String?
title : String?
file_name : String?
mime_type : String?
file_size : Int64?
thumbnail : PhotoSize?
}

Represents an audio file to be treated as music by the Telegram clients.
impl Eq for Audio
impl Show for Audio
impl ToJson for Audio

#
Audio::new

fn Audio::new(file_id~ : String, file_unique_id~ : String, duration~ : Int, performer? : String, title? : String, file_name? : String, mime_type? : String, file_size? : Int64, thumbnail? : PhotoSize) -> Audio

Creates a new [Audio].

#
BackgroundFill

pub(all) enum BackgroundFill {
Solid(BackgroundFillSolid)
Gradient(BackgroundFillGradient)
FreeformGradient(BackgroundFillFreeformGradient)
}

This object describes the way a background is filled based on the selected colors.

#
BackgroundFillFreeformGradient

pub struct BackgroundFillFreeformGradient {
colors : Array[Int]
}

The background is a freeform gradient that rotates after every message in the chat.

#
BackgroundFillFreeformGradient::new

Creates a new [BackgroundFillFreeformGradient].

#
BackgroundFillGradient

pub struct BackgroundFillGradient {
top_color : Int
bottom_color : Int
rotation_angle : Int
}

The background is a gradient fill.

#
BackgroundFillGradient::new

fn BackgroundFillGradient::new(top_color~ : Int, bottom_color~ : Int, rotation_angle~ : Int) -> BackgroundFillGradient

Creates a new [BackgroundFillGradient].

#
BackgroundFillSolid

pub struct BackgroundFillSolid {
color : Int
}

The background is filled using the selected color.

#
BackgroundFillSolid::new

fn BackgroundFillSolid::new(color~ : Int) -> BackgroundFillSolid

Creates a new [BackgroundFillSolid].

#
BackgroundType

pub(all) enum BackgroundType {
Fill(BackgroundTypeFill)
Wallpaper(BackgroundTypeWallpaper)
Pattern(BackgroundTypePattern)
ChatTheme(BackgroundTypeChatTheme)
}

This object describes the type of a background.

#
BackgroundTypeChatTheme

pub struct BackgroundTypeChatTheme {
theme_name : String
}

The background is taken directly from a built-in chat theme.

#
BackgroundTypeChatTheme::new

fn BackgroundTypeChatTheme::new(theme_name~ : String) -> BackgroundTypeChatTheme

Creates a new [BackgroundTypeChatTheme].

#
BackgroundTypeFill

pub struct BackgroundTypeFill {
fill : BackgroundFill
dark_theme_dimming : Int
}

The background is automatically filled based on the selected colors.

#
BackgroundTypeFill::new

fn BackgroundTypeFill::new(fill~ : BackgroundFill, dark_theme_dimming~ : Int) -> BackgroundTypeFill

Creates a new [BackgroundTypeFill].

#
BackgroundTypePattern

pub struct BackgroundTypePattern {
document : DocumentPlaceholder
fill : BackgroundFill
intensity : Int
is_inverted : Bool?
is_moving : Bool?
}

The background is a PNG or TGV pattern to be combined with the background fill chosen by the user.

#
BackgroundTypePattern::new

fn BackgroundTypePattern::new(document~ : DocumentPlaceholder, fill~ : BackgroundFill, intensity~ : Int, is_inverted? : Bool, is_moving? : Bool) -> BackgroundTypePattern

Creates a new [BackgroundTypePattern].

#
BackgroundTypeWallpaper

pub struct BackgroundTypeWallpaper {
document : DocumentPlaceholder
dark_theme_dimming : Int
is_blurred : Bool?
is_moving : Bool?
}

The background is a wallpaper in the JPEG format.

#
BackgroundTypeWallpaper::new

fn BackgroundTypeWallpaper::new(document~ : DocumentPlaceholder, dark_theme_dimming~ : Int, is_blurred? : Bool, is_moving? : Bool) -> BackgroundTypeWallpaper

Creates a new [BackgroundTypeWallpaper].

#
Birthdate

pub struct Birthdate {
day : Int
month : Int
year : Int?
}

Describes the birthdate of a user.
impl Eq for Birthdate
impl Show for Birthdate
impl ToJson for Birthdate

#
Birthdate::new

fn Birthdate::new(day~ : Int, month~ : Int, year? : Int) -> Birthdate

Creates a new [Birthdate].

#
Bot

pub struct Bot {
token : String
base_url : String
}

Represents a Telegram Bot API client.

#
Bot::answer_callback_query

async fn Bot::answer_callback_query(self : Bot, callback_query_id~ : String, text? : String, show_alert? : Bool) -> Bool raise TelegramError

Use this method to send answers to callback queries sent from inline keyboards. On success, True is returned.

#
Bot::answer_inline_query

async fn Bot::answer_inline_query(self : Bot, inline_query_id~ : String, results~ : Array[Json], cache_time? : Int, is_personal? : Bool, next_offset? : String, button? : InlineQueryResultsButton) -> Bool raise TelegramError

Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.

#
Bot::answer_pre_checkout_query

async fn Bot::answer_pre_checkout_query(self : Bot, pre_checkout_query_id~ : String, ok~ : Bool, error_message? : String) -> Bool raise TelegramError

Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

#
Bot::answer_shipping_query

async fn Bot::answer_shipping_query(self : Bot, shipping_query_id~ : String, ok~ : Bool, shipping_options? : Array[ShippingOption], error_message? : String) -> Bool raise TelegramError

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.

#
Bot::answer_web_app_query

async fn Bot::answer_web_app_query(self : Bot, web_app_query_id~ : String, result~ : Json) -> Json raise TelegramError

Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.

#
Bot::approve_chat_join_request

async fn Bot::approve_chat_join_request(self : Bot, chat_id~ : Int64, user_id~ : Int64) -> Bool raise TelegramError

Use this method to approve a chat join request. Returns True on success.

#
Bot::approve_suggested_post

async fn Bot::approve_suggested_post(self : Bot, chat_id~ : Int64, user_id~ : Int64, inline_message_id? : String, message_id? : Int) -> Bool raise TelegramError

Use this method to approve a suggested post. Returns True on success.

#
Bot::ban_chat_member

async fn Bot::ban_chat_member(self : Bot, chat_id~ : Int64, user_id~ : Int64, until_date? : Int, revoke_messages? : Bool) -> Bool raise TelegramError

Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. Returns True on success.

#
Bot::close_forum_topic

async fn Bot::close_forum_topic(self : Bot, chat_id~ : Int64, message_thread_id~ : Int) -> Bool raise TelegramError

Use this method to close an open topic in a forum supergroup chat. Returns True on success.

#
Bot::close_general_forum_topic

async fn Bot::close_general_forum_topic(self : Bot, chat_id~ : Int64) -> Bool raise TelegramError

Use this method to close an open 'General' topic in a forum supergroup chat. Returns True on success.

#
Bot::copy_message

async fn Bot::copy_message(self : Bot, chat_id~ : Int64, from_chat_id~ : Int64, message_id~ : Int, disable_notification? : Bool, reply_markup? : InlineKeyboardMarkup) -> MessageId raise TelegramError

Use this method to copy messages of any kind. Returns the MessageId of the sent message on success.
async fn Bot::create_chat_invite_link(self : Bot, chat_id~ : Int64, name? : String, expire_date? : Int, member_limit? : Int, creates_join_request? : Bool) -> Json raise TelegramError

Use this method to create an additional invite link for a chat. Returns the new invite link as ChatInviteLink object.

#
Bot::create_forum_topic

async fn Bot::create_forum_topic(self : Bot, chat_id~ : Int64, name~ : String, icon_color? : Int, icon_custom_emoji_id? : String) -> Json raise TelegramError

Use this method to create a topic in a forum supergroup chat. Returns information about the created topic as a ForumTopic object.
async fn Bot::create_invoice_link(self : Bot, title~ : String, description~ : String, payload~ : String, currency~ : String, prices~ : Array[LabeledPrice], provider_token? : String, max_tip_amount? : Int, suggested_tip_amounts? : Array[Int], provider_data? : String, photo_url? : String, photo_size? : Int, photo_width? : Int, photo_height? : Int, need_name? : Bool, need_phone_number? : Bool, need_email? : Bool, need_shipping_address? : Bool, send_phone_number_to_provider? : Bool, send_email_to_provider? : Bool, is_flexible? : Bool, subscription_period? : Int, business_connection_id? : String) -> String raise TelegramError

Use this method to create a link for an invoice. Returns the created invoice link as String on success.

#
Bot::decline_chat_join_request

async fn Bot::decline_chat_join_request(self : Bot, chat_id~ : Int64, user_id~ : Int64) -> Bool raise TelegramError

Use this method to decline a chat join request. Returns True on success.

#
Bot::decline_suggested_post

async fn Bot::decline_suggested_post(self : Bot, chat_id~ : Int64, user_id~ : Int64, inline_message_id? : String, message_id? : Int) -> Bool raise TelegramError

Use this method to decline a suggested post. Returns True on success.

#
Bot::delete_chat_photo

async fn Bot::delete_chat_photo(self : Bot, chat_id~ : Int64) -> Bool raise TelegramError

Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

#
Bot::delete_forum_topic

async fn Bot::delete_forum_topic(self : Bot, chat_id~ : Int64, message_thread_id~ : Int) -> Bool raise TelegramError

Use this method to delete a forum topic along with all its messages in a forum supergroup chat. Returns True on success.

#
Bot::delete_message

async fn Bot::delete_message(self : Bot, chat_id~ : Int64, message_id~ : Int) -> Bool raise TelegramError

Use this method to delete a message, including service messages. Returns True on success.

#
Bot::delete_messages

async fn Bot::delete_messages(self : Bot, chat_id~ : Int64, message_ids~ : Array[Int]) -> Bool raise TelegramError

Use this method to delete multiple messages simultaneously. Returns True on success.

#
Bot::delete_my_commands

async fn Bot::delete_my_commands(self : Bot, scope? : Json, language_code? : String) -> Bool raise TelegramError

Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.

#
Bot::delete_sticker_from_set

async fn Bot::delete_sticker_from_set(self : Bot, sticker~ : String) -> Bool raise TelegramError

Use this method to delete a sticker from a set created by the bot. Returns True on success.

#
Bot::delete_sticker_set

async fn Bot::delete_sticker_set(self : Bot, name~ : String) -> Bool raise TelegramError

Use this method to delete a sticker set that was created by the bot. Returns True on success.

#
Bot::delete_webhook

async fn Bot::delete_webhook(self : Bot, drop_pending_updates? : Bool) -> Bool raise TelegramError

Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
async fn Bot::edit_chat_invite_link(self : Bot, chat_id~ : Int64, invite_link~ : String, name? : String, expire_date? : Int, member_limit? : Int, creates_join_request? : Bool) -> Json raise TelegramError

Use this method to edit a non-primary invite link created by the bot. Returns the edited invite link as ChatInviteLink object.

#
Bot::edit_forum_topic

async fn Bot::edit_forum_topic(self : Bot, chat_id~ : Int64, message_thread_id~ : Int, name? : String, icon_custom_emoji_id? : String) -> Bool raise TelegramError

Use this method to edit name and icon of a topic in a forum supergroup chat. Returns True on success.

#
Bot::edit_general_forum_topic

async fn Bot::edit_general_forum_topic(self : Bot, chat_id~ : Int64, name~ : String) -> Bool raise TelegramError

Use this method to edit the name of the 'General' topic in a forum supergroup chat. Returns True on success.

#
Bot::edit_message_caption

async fn Bot::edit_message_caption(self : Bot, business_connection_id? : String, chat_id? : Int64, message_id? : Int, inline_message_id? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to edit captions of messages. On success, the edited Message is returned.

#
Bot::edit_message_checklist

async fn Bot::edit_message_checklist(self : Bot, business_connection_id? : String, chat_id? : Int64, message_id? : Int, inline_message_id? : String, reply_to_message_id? : Int, checklist~ : InputChecklist) -> Message raise TelegramError

Use this method to edit a checklist attached to a message. On success, edited Message is returned.

#
Bot::edit_message_live_location

async fn Bot::edit_message_live_location(self : Bot, latitude~ : Double, longitude~ : Double, business_connection_id? : String, chat_id? : Int64, message_id? : Int, inline_message_id? : String, live_period? : Int, horizontal_accuracy? : Double, heading? : Int, proximity_alert_radius? : Int, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to edit live location messages. On success, the edited Message is returned.

#
Bot::edit_message_media

async fn Bot::edit_message_media(self : Bot, media~ : Json, business_connection_id? : String, chat_id? : Int64, message_id? : Int, inline_message_id? : String, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to edit animation, audio, document, photo, or video messages. On success, the edited Message is returned.

#
Bot::edit_message_reply_markup

async fn Bot::edit_message_reply_markup(self : Bot, chat_id~ : Int64, message_id~ : Int, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to edit only the reply markup of messages. On success, the edited Message is returned.

#
Bot::edit_message_text

async fn Bot::edit_message_text(self : Bot, chat_id~ : Int64, message_id~ : Int, text~ : String, parse_mode? : String, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to edit text and game messages. On success, the edited Message is returned.
async fn Bot::export_chat_invite_link(self : Bot, chat_id~ : Int64) -> String raise TelegramError

Use this method to generate a new primary invite link for a chat. Any previously generated primary link is revoked. Returns the new invite link as String on success.

#
Bot::forward_message

async fn Bot::forward_message(self : Bot, chat_id~ : Int64, from_chat_id~ : Int64, message_id~ : Int, message_thread_id? : Int, disable_notification? : Bool, protect_content? : Bool) -> Message raise TelegramError

Use this method to forward messages of any kind. On success, the sent Message is returned.

#
Bot::forward_messages

async fn Bot::forward_messages(self : Bot, chat_id~ : Int64, from_chat_id~ : Int64, message_ids~ : Array[Int], message_thread_id? : Int, disable_notification? : Bool, protect_content? : Bool) -> Array[MessageId] raise TelegramError

Use this method to forward multiple messages of any kind. On success, an Array of MessageId of the sent messages is returned.

#
Bot::get_chat

async fn Bot::get_chat(self : Bot, chat_id~ : Int64) -> ChatFullInfo raise TelegramError

Use this method to get up to date information about the chat. Returns a ChatFullInfo object on success.

#
Bot::get_chat_administrators

async fn Bot::get_chat_administrators(self : Bot, chat_id~ : ChatId) -> Array[Json] raise TelegramError

Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.

#
Bot::get_chat_gifts

async fn Bot::get_chat_gifts(self : Bot, chat_id~ : ChatId, offset? : Int, limit? : Int) -> Gifts raise TelegramError

Use this method to get list of gifts that were sent to user. Returns Gifts on success.

#
Bot::get_chat_member

async fn Bot::get_chat_member(self : Bot, chat_id~ : ChatId, user_id~ : Int64) -> Json raise TelegramError

Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.

#
Bot::get_chat_member_count

async fn Bot::get_chat_member_count(self : Bot, chat_id~ : ChatId) -> Int raise TelegramError

Use this method to get the number of members in a chat. Returns Int on success.

#
Bot::get_chat_menu_button

async fn Bot::get_chat_menu_button(self : Bot, chat_id? : Int64) -> Json raise TelegramError

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.

#
Bot::get_custom_emoji_stickers

async fn Bot::get_custom_emoji_stickers(self : Bot, custom_emoji_ids~ : Array[String]) -> Array[Sticker] raise TelegramError

Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.

#
Bot::get_file

async fn Bot::get_file(self : Bot, file_id~ : String) -> File raise TelegramError

Use this method to get basic information about a file and prepare it for downloading. On success, a File object is returned.

#
Bot::get_forum_topic_icon_stickers

async fn Bot::get_forum_topic_icon_stickers(self : Bot) -> Array[Sticker] raise TelegramError

Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Returns an Array of Sticker objects.

#
Bot::get_game_high_scores

async fn Bot::get_game_high_scores(self : Bot, user_id~ : Int64, chat_id? : Int64, message_id? : Int, inline_message_id? : String) -> Array[Json] raise TelegramError

Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.

#
Bot::get_me

async fn Bot::get_me(self : Bot) -> User raise TelegramError

A simple method for testing your bot's auth token. Returns basic information about the bot in form of a User object.

#
Bot::get_my_commands

async fn Bot::get_my_commands(self : Bot, scope? : Json, language_code? : String) -> Array[BotCommand] raise TelegramError

Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.

#
Bot::get_my_description

async fn Bot::get_my_description(self : Bot, language_code? : String) -> Json raise TelegramError

Use this method to get the current bot description for the given user language. Returns BotDescription on success.

#
Bot::get_my_name

async fn Bot::get_my_name(self : Bot, language_code? : String) -> Json raise TelegramError

Use this method to get the current bot name for the given user language. Returns BotName on success.

#
Bot::get_my_short_description

async fn Bot::get_my_short_description(self : Bot, language_code? : String) -> Json raise TelegramError

Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.

#
Bot::get_my_star_balance

async fn Bot::get_my_star_balance(self : Bot) -> StarBalance raise TelegramError

Use this method to get number of Telegram Stars that can be spent by bot. Returns StarBalance on success.

#
Bot::get_sticker_set

async fn Bot::get_sticker_set(self : Bot, name~ : String) -> StickerSet raise TelegramError

Use this method to get a sticker set. On success, a StickerSet object is returned.

#
Bot::get_updates

async fn Bot::get_updates(self : Bot, offset? : Int, limit? : Int, timeout? : Int, allowed_updates? : Array[String]) -> Array[Update] raise TelegramError

Use this method to receive incoming updates using long polling. Returns an Array of Update objects.

#
Bot::get_user_gifts

async fn Bot::get_user_gifts(self : Bot, offset? : Int, limit? : Int) -> Gifts raise TelegramError

Use this method to get list of gifts that can be sent by user. Returns Gifts on success.

#
Bot::get_user_profile_photos

async fn Bot::get_user_profile_photos(self : Bot, user_id~ : Int64, offset? : Int, limit? : Int) -> Json raise TelegramError

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

#
Bot::get_webhook_info

async fn Bot::get_webhook_info(self : Bot) -> WebhookInfo raise TelegramError

Use this method to get current webhook status. On success, returns a WebhookInfo object.

#
Bot::hide_general_forum_topic

async fn Bot::hide_general_forum_topic(self : Bot, chat_id~ : Int64) -> Bool raise TelegramError

Use this method to hide the 'General' topic in a forum supergroup chat. Returns True on success.

#
Bot::leave_chat

async fn Bot::leave_chat(self : Bot, chat_id~ : Int64) -> Bool raise TelegramError

Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

#
Bot::new

fn Bot::new(token~ : String, base_url? : String) -> Bot

Creates a new Bot.

#
Bot::pin_chat_message

async fn Bot::pin_chat_message(self : Bot, chat_id~ : Int64, message_id~ : Int, business_connection_id? : String, disable_notification? : Bool) -> Bool raise TelegramError

Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

#
Bot::promote_chat_member

async fn Bot::promote_chat_member(self : Bot, chat_id~ : Int64, user_id~ : Int64, is_anonymous? : Bool, can_manage_chat? : Bool, can_delete_messages? : Bool, can_manage_video_chats? : Bool, can_restrict_members? : Bool, can_promote_members? : Bool, can_change_info? : Bool, can_invite_users? : Bool, can_post_stories? : Bool, can_edit_stories? : Bool, can_delete_stories? : Bool, can_post_messages? : Bool, can_edit_messages? : Bool, can_pin_messages? : Bool, can_manage_topics? : Bool) -> Bool raise TelegramError

Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

#
Bot::reopen_forum_topic

async fn Bot::reopen_forum_topic(self : Bot, chat_id~ : Int64, message_thread_id~ : Int) -> Bool raise TelegramError

Use this method to reopen a closed topic in a forum supergroup chat. Returns True on success.

#
Bot::reopen_general_forum_topic

async fn Bot::reopen_general_forum_topic(self : Bot, chat_id~ : Int64) -> Bool raise TelegramError

Use this method to reopen a closed 'General' topic in a forum supergroup chat. Returns True on success.

#
Bot::repost_story

async fn Bot::repost_story(self : Bot, chat_id~ : ChatId, from_chat_id~ : ChatId, story_id~ : Int, message_thread_id? : Int, direct_messages_topic_id? : Int, business_connection_id? : String, text? : String, parse_mode? : String, entities? : Array[MessageEntity]) -> MessageId raise TelegramError

Use this method to repost stories across business accounts. On success, MessageId of the reposted story is returned.

#
Bot::restrict_chat_member

async fn Bot::restrict_chat_member(self : Bot, chat_id~ : Int64, user_id~ : Int64, permissions~ : ChatPermissions, use_independent_chat_permissions? : Bool, until_date? : Int) -> Bool raise TelegramError

Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Returns True on success.
async fn Bot::revoke_chat_invite_link(self : Bot, chat_id~ : Int64, invite_link~ : String) -> Json raise TelegramError

Use this method to revoke an invite link created by the bot. Returns the revoked invite link as ChatInviteLink object.

#
Bot::send_animation

async fn Bot::send_animation(self : Bot, chat_id~ : Int64, animation~ : String, business_connection_id? : String, message_thread_id? : Int, duration? : Int, width? : Int, height? : Int, thumbnail? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, has_spoiler? : Bool, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned.

#
Bot::send_audio

async fn Bot::send_audio(self : Bot, chat_id~ : Int64, audio~ : String, business_connection_id? : String, message_thread_id? : Int, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], duration? : Int, performer? : String, title? : String, thumbnail? : String, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned.

#
Bot::send_chat_action

async fn Bot::send_chat_action(self : Bot, chat_id~ : Int64, action~ : String, business_connection_id? : String, message_thread_id? : Int) -> Bool raise TelegramError

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). On success, True is returned.

#
Bot::send_checklist

async fn Bot::send_checklist(self : Bot, business_connection_id? : String, chat_id~ : Int64, message_thread_id? : Int, checklist~ : InputChecklist) -> Message raise TelegramError

Use this method to send a checklist. On success, sent Message is returned.

#
Bot::send_contact

async fn Bot::send_contact(self : Bot, chat_id~ : Int64, phone_number~ : String, first_name~ : String, business_connection_id? : String, message_thread_id? : Int, last_name? : String, vcard? : String, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send phone contacts. On success, the sent Message is returned.

#
Bot::send_dice

async fn Bot::send_dice(self : Bot, chat_id~ : Int64, business_connection_id? : String, message_thread_id? : Int, emoji? : String, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

#
Bot::send_document

async fn Bot::send_document(self : Bot, chat_id~ : Int64, document~ : String, business_connection_id? : String, message_thread_id? : Int, thumbnail? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], disable_content_type_detection? : Bool, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send general files. On success, the sent Message is returned.

#
Bot::send_game

async fn Bot::send_game(self : Bot, chat_id~ : Int64, game_short_name~ : String, business_connection_id? : String, message_thread_id? : Int, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send a game. On success, the sent Message is returned.

#
Bot::send_invoice

async fn Bot::send_invoice(self : Bot, chat_id~ : Int64, title~ : String, description~ : String, payload~ : String, currency~ : String, prices~ : Array[LabeledPrice], provider_token? : String, message_thread_id? : Int, max_tip_amount? : Int, suggested_tip_amounts? : Array[Int], start_parameter? : String, provider_data? : String, photo_url? : String, photo_size? : Int, photo_width? : Int, photo_height? : Int, need_name? : Bool, need_phone_number? : Bool, need_email? : Bool, need_shipping_address? : Bool, send_phone_number_to_provider? : Bool, send_email_to_provider? : Bool, is_flexible? : Bool, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send invoices. On success, the sent Message is returned.

#
Bot::send_location

async fn Bot::send_location(self : Bot, chat_id~ : Int64, latitude~ : Double, longitude~ : Double, business_connection_id? : String, message_thread_id? : Int, horizontal_accuracy? : Double, live_period? : Int, heading? : Int, proximity_alert_radius? : Int, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send point on the map. On success, the sent Message is returned.

#
Bot::send_message

async fn Bot::send_message(self : Bot, chat_id~ : Int64, text~ : String, parse_mode? : String, disable_notification? : Bool, reply_to_message_id? : Int, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send text messages. On success, the sent Message is returned.

#
Bot::send_message_draft

async fn Bot::send_message_draft(self : Bot, chat_id~ : ChatId, text~ : String, message_thread_id? : Int, direct_messages_topic_id? : Int, business_connection_id? : String, parse_mode? : String, entities? : Array[MessageEntity], link_preview_options? : LinkPreviewOptions, disable_web_page_preview? : Bool) -> MessageId raise TelegramError

Use this method to send draft text messages. This method allows streaming partial messages. On success, MessageId of the sent message is returned.

#
Bot::send_photo

async fn Bot::send_photo(self : Bot, chat_id~ : Int64, photo~ : String, business_connection_id? : String, message_thread_id? : Int, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, has_spoiler? : Bool, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send photos. On success, the sent Message is returned.

#
Bot::send_poll

async fn Bot::send_poll(self : Bot, chat_id~ : Int64, question~ : String, options~ : Array[InputPollOption], business_connection_id? : String, message_thread_id? : Int, question_parse_mode? : String, question_entities? : Array[MessageEntity], is_anonymous? : Bool, type_? : String, allows_multiple_answers? : Bool, correct_option_id? : Int, explanation? : String, explanation_parse_mode? : String, explanation_entities? : Array[MessageEntity], open_period? : Int, close_date? : Int, is_closed? : Bool, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send a native poll. On success, the sent Message is returned.

#
Bot::send_sticker

async fn Bot::send_sticker(self : Bot, chat_id~ : Int64, sticker~ : String, business_connection_id? : String, message_thread_id? : Int, emoji? : String, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.

#
Bot::send_venue

async fn Bot::send_venue(self : Bot, chat_id~ : Int64, latitude~ : Double, longitude~ : Double, title~ : String, address~ : String, business_connection_id? : String, message_thread_id? : Int, foursquare_id? : String, foursquare_type? : String, google_place_id? : String, google_place_type? : String, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send information about a venue. On success, the sent Message is returned.

#
Bot::send_video

async fn Bot::send_video(self : Bot, chat_id~ : Int64, video~ : String, business_connection_id? : String, message_thread_id? : Int, duration? : Int, width? : Int, height? : Int, thumbnail? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, has_spoiler? : Bool, supports_streaming? : Bool, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send video files. On success, the sent Message is returned.

#
Bot::send_video_note

async fn Bot::send_video_note(self : Bot, chat_id~ : Int64, video_note~ : String, business_connection_id? : String, message_thread_id? : Int, duration? : Int, length? : Int, thumbnail? : String, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send video messages (video notes). On success, the sent Message is returned.

#
Bot::send_voice

async fn Bot::send_voice(self : Bot, chat_id~ : Int64, voice~ : String, business_connection_id? : String, message_thread_id? : Int, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], duration? : Int, disable_notification? : Bool, protect_content? : Bool, allow_paid_broadcast? : Bool, message_effect_id? : String, reply_parameters? : ReplyParameters, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to send voice messages. On success, the sent Message is returned.

#
Bot::set_chat_administrator_custom_title

async fn Bot::set_chat_administrator_custom_title(self : Bot, chat_id~ : Int64, user_id~ : Int64, custom_title~ : String) -> Bool raise TelegramError

Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.

#
Bot::set_chat_description

async fn Bot::set_chat_description(self : Bot, chat_id~ : Int64, description? : String) -> Bool raise TelegramError

Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

#
Bot::set_chat_menu_button

async fn Bot::set_chat_menu_button(self : Bot, chat_id? : Int64, menu_button? : Json) -> Bool raise TelegramError

Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.

#
Bot::set_chat_permissions

async fn Bot::set_chat_permissions(self : Bot, chat_id~ : Int64, permissions~ : ChatPermissions, use_independent_chat_permissions? : Bool) -> Bool raise TelegramError

Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.

#
Bot::set_chat_photo

async fn Bot::set_chat_photo(self : Bot, chat_id~ : Int64, photo~ : String) -> Bool raise TelegramError

Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

#
Bot::set_chat_title

async fn Bot::set_chat_title(self : Bot, chat_id~ : Int64, title~ : String) -> Bool raise TelegramError

Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

#
Bot::set_game_score

async fn Bot::set_game_score(self : Bot, user_id~ : Int64, score~ : Int, force? : Bool, disable_edit_message? : Bool, chat_id? : Int64, message_id? : Int, inline_message_id? : String) -> Json raise TelegramError

Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.

#
Bot::set_my_commands

async fn Bot::set_my_commands(self : Bot, commands~ : Array[BotCommand]) -> Bool raise TelegramError

Use this method to change the list of the bot's commands. On success, True is returned.

#
Bot::set_my_description

async fn Bot::set_my_description(self : Bot, description? : String, language_code? : String) -> Bool raise TelegramError

Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.

#
Bot::set_my_name

async fn Bot::set_my_name(self : Bot, name? : String, language_code? : String) -> Bool raise TelegramError

Use this method to change the bot's name. Returns True on success.

#
Bot::set_my_short_description

async fn Bot::set_my_short_description(self : Bot, short_description? : String, language_code? : String) -> Bool raise TelegramError

Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success.

#
Bot::set_sticker_emoji_list

async fn Bot::set_sticker_emoji_list(self : Bot, sticker~ : String, emoji_list~ : Array[String]) -> Bool raise TelegramError

Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.

#
Bot::set_sticker_position_in_set

async fn Bot::set_sticker_position_in_set(self : Bot, sticker~ : String, position~ : Int) -> Bool raise TelegramError

Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.

#
Bot::set_webhook

async fn Bot::set_webhook(self : Bot, url~ : String, certificate? : String, ip_address? : String, max_connections? : Int, allowed_updates? : Array[String], drop_pending_updates? : Bool, secret_token? : String) -> Bool raise TelegramError

Use this method to specify a URL and receive incoming updates via an outgoing webhook. Returns True on success.

#
Bot::stop_message_live_location

async fn Bot::stop_message_live_location(self : Bot, business_connection_id? : String, chat_id? : Int64, message_id? : Int, inline_message_id? : String, reply_markup? : InlineKeyboardMarkup) -> Message raise TelegramError

Use this method to stop updating a live location message before live_period expires. On success, the edited Message is returned.

#
Bot::unban_chat_member

async fn Bot::unban_chat_member(self : Bot, chat_id~ : Int64, user_id~ : Int64, only_if_banned? : Bool) -> Bool raise TelegramError

Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. Returns True on success.

#
Bot::unhide_general_forum_topic

async fn Bot::unhide_general_forum_topic(self : Bot, chat_id~ : Int64) -> Bool raise TelegramError

Use this method to unhide the 'General' topic in a forum supergroup chat. Returns True on success.

#
Bot::unpin_all_chat_messages

async fn Bot::unpin_all_chat_messages(self : Bot, chat_id~ : Int64) -> Bool raise TelegramError

Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

#
Bot::unpin_all_forum_topic_messages

async fn Bot::unpin_all_forum_topic_messages(self : Bot, chat_id~ : Int64, message_thread_id~ : Int) -> Bool raise TelegramError

Use this method to clear the list of pinned messages in a forum topic. Returns True on success.

#
Bot::unpin_chat_message

async fn Bot::unpin_chat_message(self : Bot, chat_id~ : Int64, business_connection_id? : String, message_id? : Int) -> Bool raise TelegramError

Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

#
Bot::upload_sticker_file

async fn Bot::upload_sticker_file(self : Bot, user_id~ : Int64, sticker~ : String, sticker_format~ : String) -> File raise TelegramError

Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods. Returns the uploaded File on success.

#
BotCommand

pub struct BotCommand {
command : String
description : String
}

This object represents a bot command.
impl Eq for BotCommand
impl Show for BotCommand

#
BotCommand::new

fn BotCommand::new(command~ : String, description~ : String) -> BotCommand

Creates a new [BotCommand].

#
BotCommandScope

pub(all) enum BotCommandScope {
Default
AllPrivateChats
AllGroupChats
AllChatAdministrators
Chat(BotCommandScopeChat)
ChatAdministrators(BotCommandScopeChatAdministrators)
ChatMember(BotCommandScopeChatMember)
}

This object represents the scope to which bot commands are applied.

#
BotCommandScopeChat

pub struct BotCommandScopeChat {
chat_id : Int64
}

Represents the scope of bot commands, covering a specific chat.

#
BotCommandScopeChat::new

fn BotCommandScopeChat::new(chat_id~ : Int64) -> BotCommandScopeChat

Creates a new [BotCommandScopeChat].

#
BotCommandScopeChatAdministrators

pub struct BotCommandScopeChatAdministrators {
chat_id : Int64
}

Represents the scope of bot commands, covering all administrators of a specific chat.

#
BotCommandScopeChatAdministrators::new

Creates a new [BotCommandScopeChatAdministrators].

#
BotCommandScopeChatMember

pub struct BotCommandScopeChatMember {
chat_id : Int64
user_id : Int64
}

Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

#
BotCommandScopeChatMember::new

fn BotCommandScopeChatMember::new(chat_id~ : Int64, user_id~ : Int64) -> BotCommandScopeChatMember

Creates a new [BotCommandScopeChatMember].

#
BusinessConnection

pub struct BusinessConnection {
id : String
user : User
user_chat_id : Int64
date : Int
can_reply : Bool
is_enabled : Bool
}

Describes the connection of the bot with a business account.

#
BusinessConnection::new

fn BusinessConnection::new(id~ : String, user~ : User, user_chat_id~ : Int64, date~ : Int, can_reply~ : Bool, is_enabled~ : Bool) -> BusinessConnection

Creates a new [BusinessConnection].

#
BusinessIntro

pub struct BusinessIntro {
title : String?
message : String?
sticker : Sticker?
}

Contains information about the intro of a business account.
impl Eq for BusinessIntro

#
BusinessIntro::new

fn BusinessIntro::new(title? : String, message? : String, sticker? : Sticker) -> BusinessIntro

Creates a new [BusinessIntro].

#
BusinessLocation

pub struct BusinessLocation {
address : String
location : Location?
}

Contains information about the location of a business.

#
BusinessLocation::new

fn BusinessLocation::new(address~ : String, location? : Location) -> BusinessLocation

Creates a new [BusinessLocation].

#
BusinessMessagesDeleted

pub struct BusinessMessagesDeleted {
business_connection_id : String
chat : Chat
message_ids : Array[Int]
}

This object is received when messages are deleted from a connected business account.

#
BusinessMessagesDeleted::new

fn BusinessMessagesDeleted::new(business_connection_id~ : String, chat~ : Chat, message_ids~ : Array[Int]) -> BusinessMessagesDeleted

Creates a new [BusinessMessagesDeleted].

#
BusinessOpeningHours

pub struct BusinessOpeningHours {
time_zone_name : String
opening_hours : Array[BusinessOpeningHoursInterval]
}

Contains information about the opening hours of a business.

#
BusinessOpeningHours::new

fn BusinessOpeningHours::new(time_zone_name~ : String, opening_hours~ : Array[BusinessOpeningHoursInterval]) -> BusinessOpeningHours

Creates a new [BusinessOpeningHours].

#
BusinessOpeningHoursInterval

pub struct BusinessOpeningHoursInterval {
opening_minute : Int
closing_minute : Int
}

Describes an interval of time during which a business is open.

#
BusinessOpeningHoursInterval::new

fn BusinessOpeningHoursInterval::new(opening_minute~ : Int, closing_minute~ : Int) -> BusinessOpeningHoursInterval

Creates a new [BusinessOpeningHoursInterval].

#
CachedInputMessageContent

pub struct CachedInputMessageContent {
message_text : String
}

Simplified input message content for cached inline query results.

#
CachedInputMessageContent::new

fn CachedInputMessageContent::new(message_text~ : String) -> CachedInputMessageContent

Creates a new [CachedInputMessageContent].

#
CallbackGame

pub struct CallbackGame {
}

A placeholder, currently holds no information. Use BotFather to set up your game.
impl Eq for CallbackGame

#
CallbackGame::new

Creates a new [CallbackGame].

#
CallbackQuery

pub struct CallbackQuery {
id : String
from : User
message : Message?
inline_message_id : String?
chat_instance : String
data : String?
}

This object represents an incoming callback query from a callback button in an inline keyboard.
impl Eq for CallbackQuery

#
CallbackQuery::new

fn CallbackQuery::new(id~ : String, from~ : User, message? : Message, inline_message_id? : String, chat_instance~ : String, data? : String) -> CallbackQuery

Creates a new [CallbackQuery].

#
Chat

pub struct Chat {
id : Int64
type_ : ChatType
title : String?
username : String?
first_name : String?
last_name : String?
}

This object represents a chat.
impl Eq for Chat
impl Show for Chat
impl ToJson for Chat

#
Chat::new

fn Chat::new(id~ : Int64, type_~ : ChatType, title? : String, username? : String, first_name? : String, last_name? : String) -> Chat

Creates a new [Chat].

#
ChatAdministratorRights

pub struct ChatAdministratorRights {
is_anonymous : Bool
can_manage_chat : Bool
can_delete_messages : Bool
can_manage_video_chats : Bool
can_restrict_members : Bool
can_promote_members : Bool
can_change_info : Bool
can_invite_users : Bool
can_post_stories : Bool
can_edit_stories : Bool
can_delete_stories : Bool
can_post_messages : Bool?
can_edit_messages : Bool?
can_pin_messages : Bool?
can_manage_topics : Bool?
}

Represents the rights of an administrator in a chat.

#
ChatAdministratorRights::new

fn ChatAdministratorRights::new(is_anonymous~ : Bool, can_manage_chat~ : Bool, can_delete_messages~ : Bool, can_manage_video_chats~ : Bool, can_restrict_members~ : Bool, can_promote_members~ : Bool, can_change_info~ : Bool, can_invite_users~ : Bool, can_post_stories~ : Bool, can_edit_stories~ : Bool, can_delete_stories~ : Bool, can_post_messages? : Bool, can_edit_messages? : Bool, can_pin_messages? : Bool, can_manage_topics? : Bool) -> ChatAdministratorRights

Creates a new [ChatAdministratorRights].

#
ChatBackground

pub struct ChatBackground {
type_ : BackgroundType
}

This object represents a chat background.

#
ChatBackground::new

Creates a new [ChatBackground].

#
ChatBoostAdded

pub struct ChatBoostAdded {
boost_count : Int
}

Represents a service message about a user boosting a chat.

#
ChatBoostAdded::new

fn ChatBoostAdded::new(boost_count~ : Int) -> ChatBoostAdded

Creates a new [ChatBoostAdded].

#
ChatFullInfo

pub struct ChatFullInfo {
id : Int64
type_ : String
accent_color_id : Int
max_reaction_count : Int
title : String?
username : String?
first_name : String?
last_name : String?
is_forum : Bool?
photo : ChatPhoto?
active_usernames : Array[String]?
birthdate : Birthdate?
business_intro : BusinessIntro?
business_location : BusinessLocation?
business_opening_hours : BusinessOpeningHours?
personal_chat : Chat?
available_reactions : Array[ReactionType]?
background_custom_emoji_id : String?
profile_accent_color_id : Int?
profile_background_custom_emoji_id : String?
emoji_status_custom_emoji_id : String?
emoji_status_expiration_date : Int?
bio : String?
has_private_forwards : Bool?
has_restricted_voice_and_video_messages : Bool?
join_to_send_messages : Bool?
join_by_request : Bool?
description : String?
invite_link : String?
pinned_message : Message?
permissions : ChatPermissions?
can_send_paid_media : Bool?
slow_mode_delay : Int?
unrestrict_boost_count : Int?
message_auto_delete_time : Int?
has_aggressive_anti_spam_enabled : Bool?
has_hidden_members : Bool?
has_protected_content : Bool?
has_visible_history : Bool?
sticker_set_name : String?
can_set_sticker_set : Bool?
custom_emoji_sticker_set_name : String?
linked_chat_id : Int64?
location : ChatLocation?
}

This object contains full information about a chat.
impl Eq for ChatFullInfo

#
ChatFullInfo::new

fn ChatFullInfo::new(id~ : Int64, type_~ : String, accent_color_id~ : Int, max_reaction_count~ : Int, title? : String, username? : String, first_name? : String, last_name? : String, is_forum? : Bool, photo? : ChatPhoto, active_usernames? : Array[String], birthdate? : Birthdate, business_intro? : BusinessIntro, business_location? : BusinessLocation, business_opening_hours? : BusinessOpeningHours, personal_chat? : Chat, available_reactions? : Array[ReactionType], background_custom_emoji_id? : String, profile_accent_color_id? : Int, profile_background_custom_emoji_id? : String, emoji_status_custom_emoji_id? : String, emoji_status_expiration_date? : Int, bio? : String, has_private_forwards? : Bool, has_restricted_voice_and_video_messages? : Bool, join_to_send_messages? : Bool, join_by_request? : Bool, description? : String, invite_link? : String, pinned_message? : Message, permissions? : ChatPermissions, can_send_paid_media? : Bool, slow_mode_delay? : Int, unrestrict_boost_count? : Int, message_auto_delete_time? : Int, has_aggressive_anti_spam_enabled? : Bool, has_hidden_members? : Bool, has_protected_content? : Bool, has_visible_history? : Bool, sticker_set_name? : String, can_set_sticker_set? : Bool, custom_emoji_sticker_set_name? : String, linked_chat_id? : Int64, location? : ChatLocation) -> ChatFullInfo

Creates a new [ChatFullInfo].

#
ChatId

pub(all) enum ChatId {
Id(Int64)
Username(String)
}

Unique identifier for the target chat or username of the target channel.
impl Eq for ChatId
impl Show for ChatId
impl ToJson for ChatId

#
ChatLocation

pub struct ChatLocation {
location : Location
address : String
}

Represents a location to which a chat is connected.
impl Eq for ChatLocation

#
ChatLocation::new

fn ChatLocation::new(location~ : Location, address~ : String) -> ChatLocation

Creates a new [ChatLocation].

#
ChatMember

pub(all) enum ChatMember {
Owner(ChatMemberOwner)
Administrator(ChatMemberAdministrator)
Member(ChatMemberMember)
Restricted(ChatMemberRestricted)
Left(ChatMemberLeft)
Banned(ChatMemberBanned)
}

This object contains information about one member of a chat.
impl Eq for ChatMember
impl Show for ChatMember

#
ChatMemberAdministrator

pub struct ChatMemberAdministrator {
user : User
can_be_edited : Bool
is_anonymous : Bool
can_manage_chat : Bool
can_delete_messages : Bool
can_manage_video_chats : Bool
can_restrict_members : Bool
can_promote_members : Bool
can_change_info : Bool
can_invite_users : Bool
can_post_stories : Bool
can_edit_stories : Bool
can_delete_stories : Bool
can_post_messages : Bool?
can_edit_messages : Bool?
can_pin_messages : Bool?
can_manage_topics : Bool?
custom_title : String?
}

Represents a chat member that has some additional privileges.

#
ChatMemberAdministrator::new

fn ChatMemberAdministrator::new(user~ : User, can_be_edited~ : Bool, is_anonymous~ : Bool, can_manage_chat~ : Bool, can_delete_messages~ : Bool, can_manage_video_chats~ : Bool, can_restrict_members~ : Bool, can_promote_members~ : Bool, can_change_info~ : Bool, can_invite_users~ : Bool, can_post_stories~ : Bool, can_edit_stories~ : Bool, can_delete_stories~ : Bool, can_post_messages? : Bool, can_edit_messages? : Bool, can_pin_messages? : Bool, can_manage_topics? : Bool, custom_title? : String) -> ChatMemberAdministrator

Creates a new [ChatMemberAdministrator].

#
ChatMemberBanned

pub struct ChatMemberBanned {
user : User
until_date : Int
}

Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.

#
ChatMemberBanned::new

fn ChatMemberBanned::new(user~ : User, until_date~ : Int) -> ChatMemberBanned

Creates a new [ChatMemberBanned].

#
ChatMemberLeft

pub struct ChatMemberLeft {
user : User
}

Represents a chat member that isn't currently a member of the chat but may join it themselves.

#
ChatMemberLeft::new

fn ChatMemberLeft::new(user~ : User) -> ChatMemberLeft

Creates a new [ChatMemberLeft].

#
ChatMemberMember

pub struct ChatMemberMember {
user : User
until_date : Int?
}

Represents a chat member that has no additional privileges or restrictions.

#
ChatMemberMember::new

fn ChatMemberMember::new(user~ : User, until_date? : Int) -> ChatMemberMember

Creates a new [ChatMemberMember].

#
ChatMemberOwner

pub struct ChatMemberOwner {
user : User
is_anonymous : Bool
custom_title : String?
}

Represents a chat member that owns the chat and has all administrator privileges.

#
ChatMemberOwner::new

fn ChatMemberOwner::new(user~ : User, is_anonymous~ : Bool, custom_title? : String) -> ChatMemberOwner

Creates a new [ChatMemberOwner].

#
ChatMemberRestricted

pub struct ChatMemberRestricted {
user : User
is_member : Bool
can_send_messages : Bool
can_send_audios : Bool
can_send_documents : Bool
can_send_photos : Bool
can_send_videos : Bool
can_send_video_notes : Bool
can_send_voice_notes : Bool
can_send_polls : Bool
can_send_other_messages : Bool
can_add_web_page_previews : Bool
can_change_info : Bool
can_invite_users : Bool
can_pin_messages : Bool
can_manage_topics : Bool
until_date : Int
}

Represents a chat member that is under certain restrictions in the chat. Supergroups only.

#
ChatMemberRestricted::new

fn ChatMemberRestricted::new(user~ : User, is_member~ : Bool, can_send_messages~ : Bool, can_send_audios~ : Bool, can_send_documents~ : Bool, can_send_photos~ : Bool, can_send_videos~ : Bool, can_send_video_notes~ : Bool, can_send_voice_notes~ : Bool, can_send_polls~ : Bool, can_send_other_messages~ : Bool, can_add_web_page_previews~ : Bool, can_change_info~ : Bool, can_invite_users~ : Bool, can_pin_messages~ : Bool, can_manage_topics~ : Bool, until_date~ : Int) -> ChatMemberRestricted

Creates a new [ChatMemberRestricted].

#
ChatPermissions

pub struct ChatPermissions {
can_send_messages : Bool?
can_send_audios : Bool?
can_send_documents : Bool?
can_send_photos : Bool?
can_send_videos : Bool?
can_send_video_notes : Bool?
can_send_voice_notes : Bool?
can_send_polls : Bool?
can_send_other_messages : Bool?
can_add_web_page_previews : Bool?
can_change_info : Bool?
can_invite_users : Bool?
can_pin_messages : Bool?
can_manage_topics : Bool?
}

Describes actions that a non-administrator user is allowed to take in a chat.

#
ChatPermissions::new

fn ChatPermissions::new(can_send_messages? : Bool, can_send_audios? : Bool, can_send_documents? : Bool, can_send_photos? : Bool, can_send_videos? : Bool, can_send_video_notes? : Bool, can_send_voice_notes? : Bool, can_send_polls? : Bool, can_send_other_messages? : Bool, can_add_web_page_previews? : Bool, can_change_info? : Bool, can_invite_users? : Bool, can_pin_messages? : Bool, can_manage_topics? : Bool) -> ChatPermissions

Creates a new [ChatPermissions].

#
ChatPhoto

pub struct ChatPhoto {
small_file_id : String
small_file_unique_id : String
big_file_id : String
big_file_unique_id : String
}

This object represents a chat photo.
impl Eq for ChatPhoto
impl Show for ChatPhoto
impl ToJson for ChatPhoto

#
ChatPhoto::new

fn ChatPhoto::new(small_file_id~ : String, small_file_unique_id~ : String, big_file_id~ : String, big_file_unique_id~ : String) -> ChatPhoto

Creates a new [ChatPhoto].

#
ChatShared

pub struct ChatShared {
request_id : Int
chat_id : Int64
title : String?
username : String?
photo : Array[PhotoSize]?
}

This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
impl Eq for ChatShared
impl Show for ChatShared

#
ChatShared::new

fn ChatShared::new(request_id~ : Int, chat_id~ : Int64, title? : String, username? : String, photo? : Array[PhotoSize]) -> ChatShared

Creates a new [ChatShared].

#
ChatType

pub(all) enum ChatType {
Private
Group
Supergroup
Channel
}

Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'.
impl Eq for ChatType
impl Show for ChatType
impl ToJson for ChatType

#
Checklist

pub struct Checklist {
header : String
tasks : Array[ChecklistTask]
}

Describes a checklist.
impl Eq for Checklist
impl Show for Checklist
impl ToJson for Checklist

#
Checklist::new

fn Checklist::new(header~ : String, tasks~ : Array[ChecklistTask]) -> Checklist

Creates a new [Checklist].

#
ChecklistTask

pub struct ChecklistTask {
id : Int
text : String
is_done : Bool
}

Describes a task in a checklist.
impl Eq for ChecklistTask

#
ChecklistTask::new

fn ChecklistTask::new(id~ : Int, text~ : String, is_done~ : Bool) -> ChecklistTask

Creates a new [ChecklistTask].

#
ChecklistTasksAdded

pub struct ChecklistTasksAdded {
}

Describes a service message about tasks added to a checklist.

#
ChecklistTasksAdded::new

Creates a new [ChecklistTasksAdded].

#
ChecklistTasksDone

pub struct ChecklistTasksDone {
}

Describes a service message about checklist tasks marked as done or not done.

#
ChecklistTasksDone::new

Creates a new [ChecklistTasksDone].

#
ChosenInlineResult

pub struct ChosenInlineResult {
result_id : String
from : User
location : Location?
inline_message_id : String?
query : String
}

Represents a result of an inline query that was chosen by the user and sent to their chat partner.

#
ChosenInlineResult::new

fn ChosenInlineResult::new(result_id~ : String, from~ : User, query~ : String, location? : Location, inline_message_id? : String) -> ChosenInlineResult

Creates a new [ChosenInlineResult].

#
Contact

pub struct Contact {
phone_number : String
first_name : String
last_name : String?
user_id : Int64?
vcard : String?
}

Represents a phone contact.
impl Eq for Contact
impl Show for Contact
impl ToJson for Contact

#
Contact::new

fn Contact::new(phone_number~ : String, first_name~ : String, last_name? : String, user_id? : Int64, vcard? : String) -> Contact

Creates a new [Contact].

#
Dice

pub struct Dice {
emoji : String
value : Int
}

Represents an animated emoji that displays a random value.
impl Eq for Dice
impl Show for Dice
impl ToJson for Dice

#
Dice::new

fn Dice::new(emoji~ : String, value~ : Int) -> Dice

Creates a new [Dice].

#
DirectMessagesTopic

pub struct DirectMessagesTopic {
id : Int
name : String
icon_color : Int
}

This object represents a direct messages topic.

#
DirectMessagesTopic::new

fn DirectMessagesTopic::new(id~ : Int, name~ : String, icon_color~ : Int) -> DirectMessagesTopic

Creates a new [DirectMessagesTopic].

#
Document

pub struct Document {
file_id : String
file_unique_id : String
thumbnail : PhotoSize?
file_name : String?
mime_type : String?
file_size : Int64?
}

Represents a general file (as opposed to photos, voice messages and audio files).
impl Eq for Document
impl Show for Document
impl ToJson for Document

#
Document::new

fn Document::new(file_id~ : String, file_unique_id~ : String, thumbnail? : PhotoSize, file_name? : String, mime_type? : String, file_size? : Int64) -> Document

Creates a new [Document].

#
DocumentPlaceholder

pub struct DocumentPlaceholder {
file_id : String
file_unique_id : String
}

Placeholder for a document object with basic file information.

#
DocumentPlaceholder::new

fn DocumentPlaceholder::new(file_id~ : String, file_unique_id~ : String) -> DocumentPlaceholder

Creates a new [DocumentPlaceholder].

#
EncryptedCredentials

pub struct EncryptedCredentials {
data : String
hash : String
secret : String
}

Describes data required for decrypting and authenticating EncryptedPassportElement.

#
EncryptedCredentials::new

fn EncryptedCredentials::new(data~ : String, hash~ : String, secret~ : String) -> EncryptedCredentials

Creates a new [EncryptedCredentials].

#
EncryptedPassportElement

pub struct EncryptedPassportElement {
type_ : String
data : String?
phone_number : String?
email : String?
files : Array[PassportFile]?
front_side : PassportFile?
reverse_side : PassportFile?
selfie : PassportFile?
translation : Array[PassportFile]?
hash : String
}

Describes documents or other Telegram Passport elements shared with the bot by the user.

#
EncryptedPassportElement::new

fn EncryptedPassportElement::new(type_~ : String, hash~ : String, data? : String, phone_number? : String, email? : String, files? : Array[PassportFile], front_side? : PassportFile, reverse_side? : PassportFile, selfie? : PassportFile, translation? : Array[PassportFile]) -> EncryptedPassportElement

Creates a new [EncryptedPassportElement].

#
ExternalReplyInfo

pub struct ExternalReplyInfo {
origin : MessageOriginPlaceholder
chat : Chat?
message_id : Int?
link_preview_options : LinkPreviewPlaceholder?
animation : Animation?
audio : Audio?
document : Document?
paid_media : PaidMediaInfo?
photo : Array[PhotoSize]?
sticker : Sticker?
story : Story?
video : Video?
video_note : VideoNote?
voice : Voice?
has_media_spoiler : Bool?
contact : Contact?
dice : Dice?
game : GamePlaceholder?
giveaway : Giveaway?
giveaway_winners : GiveawayWinners?
invoice : Invoice?
location : Location?
poll : Poll?
venue : Venue?
}

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

#
ExternalReplyInfo::new

fn ExternalReplyInfo::new(origin~ : MessageOriginPlaceholder, chat? : Chat, message_id? : Int, link_preview_options? : LinkPreviewPlaceholder, animation? : Animation, audio? : Audio, document? : Document, paid_media? : PaidMediaInfo, photo? : Array[PhotoSize], sticker? : Sticker, story? : Story, video? : Video, video_note? : VideoNote, voice? : Voice, has_media_spoiler? : Bool, contact? : Contact, dice? : Dice, game? : GamePlaceholder, giveaway? : Giveaway, giveaway_winners? : GiveawayWinners, invoice? : Invoice, location? : Location, poll? : Poll, venue? : Venue) -> ExternalReplyInfo

Creates a new [ExternalReplyInfo].

#
File

pub struct File {
file_id : String
file_unique_id : String
file_size : Int64?
file_path : String?
}

Represents a file ready to be downloaded.
impl Eq for File
impl Show for File
impl ToJson for File

#
File::new

fn File::new(file_id~ : String, file_unique_id~ : String, file_size? : Int64, file_path? : String) -> File

Creates a new [File].

#
FilePlaceholder

pub struct FilePlaceholder {
file_id : String
file_unique_id : String
}

Placeholder for a file reference.

#
FilePlaceholder::new

fn FilePlaceholder::new(file_id~ : String, file_unique_id~ : String) -> FilePlaceholder

Creates a new [FilePlaceholder].

#
ForceReply

pub struct ForceReply {
force_reply : Bool
input_field_placeholder : String?
selective : Bool?
}

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply').
impl Eq for ForceReply
impl Show for ForceReply

#
ForceReply::new

fn ForceReply::new(force_reply~ : Bool, input_field_placeholder? : String, selective? : Bool) -> ForceReply

Creates a new [ForceReply].

#
ForumTopic

pub struct ForumTopic {
message_thread_id : Int
name : String
icon_color : Int
icon_custom_emoji_id : String?
}

This object represents a forum topic.
impl Eq for ForumTopic
impl Show for ForumTopic

#
ForumTopic::new

fn ForumTopic::new(message_thread_id~ : Int, name~ : String, icon_color~ : Int, icon_custom_emoji_id? : String) -> ForumTopic

Creates a new [ForumTopic].

#
ForumTopicClosed

pub struct ForumTopicClosed {
}

Represents a service message about a forum topic closed in the chat. Currently holds no information.

#
ForumTopicClosed::new

Creates a new [ForumTopicClosed].

#
ForumTopicCreated

pub struct ForumTopicCreated {
name : String
icon_color : Int
icon_custom_emoji_id : String?
}

This object represents a service message about a new forum topic created in the chat.

#
ForumTopicCreated::new

fn ForumTopicCreated::new(name~ : String, icon_color~ : Int, icon_custom_emoji_id? : String) -> ForumTopicCreated

Creates a new [ForumTopicCreated].

#
ForumTopicEdited

pub struct ForumTopicEdited {
name : String?
icon_custom_emoji_id : String?
}

This object represents a service message about an edited forum topic.

#
ForumTopicEdited::new

fn ForumTopicEdited::new(name? : String, icon_custom_emoji_id? : String) -> ForumTopicEdited

Creates a new [ForumTopicEdited].

#
ForumTopicReopened

pub struct ForumTopicReopened {
}

Represents a service message about a forum topic reopened in the chat. Currently holds no information.

#
ForumTopicReopened::new

Creates a new [ForumTopicReopened].

#
GamePlaceholder

pub struct GamePlaceholder {
title : String
description : String
}

Placeholder for the Game type.

#
GamePlaceholder::new

fn GamePlaceholder::new(title~ : String, description~ : String) -> GamePlaceholder

Creates a new [GamePlaceholder].

#
GeneralForumTopicHidden

pub struct GeneralForumTopicHidden {
}

Represents a service message about General forum topic hidden in the chat. Currently holds no information.

#
GeneralForumTopicHidden::new

Creates a new [GeneralForumTopicHidden].

#
GeneralForumTopicUnhidden

pub struct GeneralForumTopicUnhidden {
}

Represents a service message about General forum topic unhidden in the chat. Currently holds no information.

#
GeneralForumTopicUnhidden::new

Creates a new [GeneralForumTopicUnhidden].

#
Gift

pub struct Gift {
id : String
sticker : StickerPlaceholder
star_count : Int
total_count : Int?
remaining_count : Int?
publisher_chat : Chat?
colors : UniqueGiftColors?
background : GiftBackground?
unique_gift_variant_count : Int?
unique_gift_number : Int?
gifts_from_channels : Bool?
is_premium : Bool?
has_colors : Bool?
}

This object represents a gift that can be sent by the bot.
impl Eq for Gift
impl Show for Gift
impl ToJson for Gift

#
Gift::new

fn Gift::new(id~ : String, sticker~ : StickerPlaceholder, star_count~ : Int, total_count? : Int, remaining_count? : Int, publisher_chat? : Chat, colors? : UniqueGiftColors, background? : GiftBackground, unique_gift_variant_count? : Int, unique_gift_number? : Int, gifts_from_channels? : Bool, is_premium? : Bool, has_colors? : Bool) -> Gift

Creates a new [Gift].

#
GiftBackground

pub struct GiftBackground {
type_ : String
fill_color : Int?
gradient_top_color : Int?
gradient_bottom_color : Int?
}

Describes the background of a unique gift.

#
GiftBackground::new

fn GiftBackground::new(type_~ : String, fill_color? : Int, gradient_top_color? : Int, gradient_bottom_color? : Int) -> GiftBackground

Creates a new [GiftBackground].

#
GiftInfo

pub struct GiftInfo {
gift : Gift
from : User?
}

Describes a service message about a regular gift that was sent or received.
impl Eq for GiftInfo
impl Show for GiftInfo
impl ToJson for GiftInfo

#
GiftInfo::new

fn GiftInfo::new(gift~ : Gift, from? : User) -> GiftInfo

Creates a new [GiftInfo].

#
Gifts

pub struct Gifts {
gifts : Array[Gift]
}

This object represents a list of gifts.
impl Eq for Gifts
impl Show for Gifts
impl ToJson for Gifts

#
Gifts::new

fn Gifts::new(gifts~ : Array[Gift]) -> Gifts

Creates a new [Gifts].

#
Giveaway

pub struct Giveaway {
chats : Array[Chat]
winners_selection_date : Int
winner_count : Int
only_new_members : Bool?
has_public_winners : Bool?
prize_description : String?
country_codes : Array[String]?
prize_star_count : Int?
premium_subscription_month_count : Int?
}

Represents a message about a scheduled giveaway.
impl Eq for Giveaway
impl Show for Giveaway
impl ToJson for Giveaway

#
Giveaway::new

fn Giveaway::new(chats~ : Array[Chat], winners_selection_date~ : Int, winner_count~ : Int, only_new_members? : Bool, has_public_winners? : Bool, prize_description? : String, country_codes? : Array[String], prize_star_count? : Int, premium_subscription_month_count? : Int) -> Giveaway

Creates a new [Giveaway].

#
GiveawayCompleted

pub struct GiveawayCompleted {
winner_count : Int
unclaimed_prize_count : Int?
giveaway_message : Message?
is_star_giveaway : Bool?
}

Represents a service message about the completion of a giveaway without public winners.

#
GiveawayCompleted::new

fn GiveawayCompleted::new(winner_count~ : Int, unclaimed_prize_count? : Int, giveaway_message? : Message, is_star_giveaway? : Bool) -> GiveawayCompleted

Creates a new [GiveawayCompleted].

#
GiveawayCreated

pub struct GiveawayCreated {
prize_star_count : Int?
}

Represents a service message about the creation of a scheduled giveaway.

#
GiveawayCreated::new

fn GiveawayCreated::new(prize_star_count? : Int) -> GiveawayCreated

Creates a new [GiveawayCreated].

#
GiveawayWinners

pub struct GiveawayWinners {
chat : Chat
giveaway_message_id : Int
winners_selection_date : Int
winner_count : Int
winners : Array[User]
additional_chat_count : Int?
prize_star_count : Int?
premium_subscription_month_count : Int?
unclaimed_prize_count : Int?
only_new_members : Bool?
was_refunded : Bool?
prize_description : String?
}

Represents a message about the completion of a giveaway with public winners.

#
GiveawayWinners::new

fn GiveawayWinners::new(chat~ : Chat, giveaway_message_id~ : Int, winners_selection_date~ : Int, winner_count~ : Int, winners~ : Array[User], additional_chat_count? : Int, prize_star_count? : Int, premium_subscription_month_count? : Int, unclaimed_prize_count? : Int, only_new_members? : Bool, was_refunded? : Bool, prize_description? : String) -> GiveawayWinners

Creates a new [GiveawayWinners].

#
InlineKeyboardButton

pub struct InlineKeyboardButton {
text : String
url : String?
callback_data : String?
}

This object represents one button of an inline keyboard.

#
InlineKeyboardButton::new

fn InlineKeyboardButton::new(text~ : String, url? : String, callback_data? : String) -> InlineKeyboardButton

Creates a new [InlineKeyboardButton].

#
InlineKeyboardMarkup

pub struct InlineKeyboardMarkup {
inline_keyboard : Array[Array[InlineKeyboardButton]]
}

This object represents an inline keyboard that appears right next to the message it belongs to.

#
InlineKeyboardMarkup::new

Creates a new [InlineKeyboardMarkup].

#
InlineQuery

pub struct InlineQuery {
id : String
from : User
query : String
offset : String
chat_type : String?
location : Location?
}

Represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
impl Eq for InlineQuery
impl Show for InlineQuery

#
InlineQuery::new

fn InlineQuery::new(id~ : String, from~ : User, query~ : String, offset~ : String, chat_type? : String, location? : Location) -> InlineQuery

Creates a new [InlineQuery].

#
InlineQueryResultArticle

pub struct InlineQueryResultArticle {
type_ : String
id : String
title : String
input_message_content : InputTextMessageContent
reply_markup : InlineKeyboardMarkup?
url : String?
hide_url : Bool?
description : String?
thumbnail_url : String?
thumbnail_width : Int?
thumbnail_height : Int?
}

Represents a link to an article or web page.

#
InlineQueryResultArticle::new

fn InlineQueryResultArticle::new(id~ : String, title~ : String, input_message_content~ : InputTextMessageContent, type_? : String, reply_markup? : InlineKeyboardMarkup, url? : String, hide_url? : Bool, description? : String, thumbnail_url? : String, thumbnail_width? : Int, thumbnail_height? : Int) -> InlineQueryResultArticle

Creates a new [InlineQueryResultArticle].

#
InlineQueryResultAudio

pub struct InlineQueryResultAudio {
type_ : String
id : String
audio_url : String
title : String
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
performer : String?
audio_duration : Int?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputMessageContentPlaceholder?
}

Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

#
InlineQueryResultAudio::new

fn InlineQueryResultAudio::new(id~ : String, audio_url~ : String, title~ : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], performer? : String, audio_duration? : Int, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputMessageContentPlaceholder) -> InlineQueryResultAudio

Creates a new [InlineQueryResultAudio].

#
InlineQueryResultCachedAudio

pub struct InlineQueryResultCachedAudio {
type_ : String
id : String
audio_file_id : String
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

#
InlineQueryResultCachedAudio::new

fn InlineQueryResultCachedAudio::new(id~ : String, audio_file_id~ : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedAudio

Creates a new [InlineQueryResultCachedAudio].

#
InlineQueryResultCachedDocument

pub struct InlineQueryResultCachedDocument {
type_ : String
id : String
title : String
document_file_id : String
description : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

#
InlineQueryResultCachedDocument::new

fn InlineQueryResultCachedDocument::new(id~ : String, title~ : String, document_file_id~ : String, description? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedDocument

Creates a new [InlineQueryResultCachedDocument].

#
InlineQueryResultCachedGif

pub struct InlineQueryResultCachedGif {
type_ : String
id : String
gif_file_id : String
title : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

#
InlineQueryResultCachedGif::new

fn InlineQueryResultCachedGif::new(id~ : String, gif_file_id~ : String, title? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedGif

Creates a new [InlineQueryResultCachedGif].

#
InlineQueryResultCachedMpeg4Gif

pub struct InlineQueryResultCachedMpeg4Gif {
type_ : String
id : String
mpeg4_file_id : String
title : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

#
InlineQueryResultCachedMpeg4Gif::new

fn InlineQueryResultCachedMpeg4Gif::new(id~ : String, mpeg4_file_id~ : String, title? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedMpeg4Gif

Creates a new [InlineQueryResultCachedMpeg4Gif].

#
InlineQueryResultCachedPhoto

pub struct InlineQueryResultCachedPhoto {
type_ : String
id : String
photo_file_id : String
title : String?
description : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

#
InlineQueryResultCachedPhoto::new

fn InlineQueryResultCachedPhoto::new(id~ : String, photo_file_id~ : String, title? : String, description? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedPhoto

Creates a new [InlineQueryResultCachedPhoto].

#
InlineQueryResultCachedSticker

pub struct InlineQueryResultCachedSticker {
type_ : String
id : String
sticker_file_id : String
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

#
InlineQueryResultCachedSticker::new

fn InlineQueryResultCachedSticker::new(id~ : String, sticker_file_id~ : String, reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedSticker

Creates a new [InlineQueryResultCachedSticker].

#
InlineQueryResultCachedVideo

pub struct InlineQueryResultCachedVideo {
type_ : String
id : String
video_file_id : String
title : String
description : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

#
InlineQueryResultCachedVideo::new

fn InlineQueryResultCachedVideo::new(id~ : String, video_file_id~ : String, title~ : String, description? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedVideo

Creates a new [InlineQueryResultCachedVideo].

#
InlineQueryResultCachedVoice

pub struct InlineQueryResultCachedVoice {
type_ : String
id : String
voice_file_id : String
title : String
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
reply_markup : InlineKeyboardMarkup?
input_message_content : CachedInputMessageContent?
}

Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

#
InlineQueryResultCachedVoice::new

fn InlineQueryResultCachedVoice::new(id~ : String, voice_file_id~ : String, title~ : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], reply_markup? : InlineKeyboardMarkup, input_message_content? : CachedInputMessageContent) -> InlineQueryResultCachedVoice

Creates a new [InlineQueryResultCachedVoice].

#
InlineQueryResultContact

pub struct InlineQueryResultContact {
type_ : String
id : String
phone_number : String
first_name : String
last_name : String?
vcard : String?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputTextMessageContent?
thumbnail_url : String?
thumbnail_width : Int?
thumbnail_height : Int?
}

Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

#
InlineQueryResultContact::new

fn InlineQueryResultContact::new(id~ : String, phone_number~ : String, first_name~ : String, type_? : String, last_name? : String, vcard? : String, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputTextMessageContent, thumbnail_url? : String, thumbnail_width? : Int, thumbnail_height? : Int) -> InlineQueryResultContact

Creates a new [InlineQueryResultContact].

#
InlineQueryResultDocument

pub struct InlineQueryResultDocument {
type_ : String
id : String
title : String
document_url : String
mime_type : String
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
description : String?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputMessageContentPlaceholder?
thumbnail_url : String?
thumbnail_width : Int?
thumbnail_height : Int?
}

Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

#
InlineQueryResultDocument::new

fn InlineQueryResultDocument::new(id~ : String, title~ : String, document_url~ : String, mime_type~ : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], description? : String, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputMessageContentPlaceholder, thumbnail_url? : String, thumbnail_width? : Int, thumbnail_height? : Int) -> InlineQueryResultDocument

Creates a new [InlineQueryResultDocument].

#
InlineQueryResultGif

pub struct InlineQueryResultGif {
type_ : String
id : String
gif_url : String
gif_width : Int?
gif_height : Int?
gif_duration : Int?
thumbnail_url : String
thumbnail_mime_type : String?
title : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputTextMessageContent?
}

Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

#
InlineQueryResultGif::new

fn InlineQueryResultGif::new(id~ : String, gif_url~ : String, thumbnail_url~ : String, gif_width? : Int, gif_height? : Int, gif_duration? : Int, thumbnail_mime_type? : String, title? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputTextMessageContent) -> InlineQueryResultGif

Creates a new [InlineQueryResultGif].

#
InlineQueryResultLocation

pub struct InlineQueryResultLocation {
type_ : String
id : String
latitude : Double
longitude : Double
title : String
horizontal_accuracy : Double?
live_period : Int?
heading : Int?
proximity_alert_radius : Int?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputTextMessageContent?
thumbnail_url : String?
thumbnail_width : Int?
thumbnail_height : Int?
}

Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

#
InlineQueryResultLocation::new

fn InlineQueryResultLocation::new(id~ : String, latitude~ : Double, longitude~ : Double, title~ : String, type_? : String, horizontal_accuracy? : Double, live_period? : Int, heading? : Int, proximity_alert_radius? : Int, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputTextMessageContent, thumbnail_url? : String, thumbnail_width? : Int, thumbnail_height? : Int) -> InlineQueryResultLocation

Creates a new [InlineQueryResultLocation].

#
InlineQueryResultMpeg4Gif

pub struct InlineQueryResultMpeg4Gif {
type_ : String
id : String
mpeg4_url : String
mpeg4_width : Int?
mpeg4_height : Int?
mpeg4_duration : Int?
thumbnail_url : String
thumbnail_mime_type : String?
title : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputTextMessageContent?
}

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

#
InlineQueryResultMpeg4Gif::new

fn InlineQueryResultMpeg4Gif::new(id~ : String, mpeg4_url~ : String, thumbnail_url~ : String, mpeg4_width? : Int, mpeg4_height? : Int, mpeg4_duration? : Int, thumbnail_mime_type? : String, title? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputTextMessageContent) -> InlineQueryResultMpeg4Gif

Creates a new [InlineQueryResultMpeg4Gif].

#
InlineQueryResultPhoto

pub struct InlineQueryResultPhoto {
type_ : String
id : String
photo_url : String
thumbnail_url : String
photo_width : Int?
photo_height : Int?
title : String?
description : String?
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputTextMessageContent?
}

Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

#
InlineQueryResultPhoto::new

fn InlineQueryResultPhoto::new(id~ : String, photo_url~ : String, thumbnail_url~ : String, photo_width? : Int, photo_height? : Int, title? : String, description? : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputTextMessageContent) -> InlineQueryResultPhoto

Creates a new [InlineQueryResultPhoto].

#
InlineQueryResultVenue

pub struct InlineQueryResultVenue {
type_ : String
id : String
latitude : Double
longitude : Double
title : String
address : String
foursquare_id : String?
foursquare_type : String?
google_place_id : String?
google_place_type : String?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputTextMessageContent?
thumbnail_url : String?
thumbnail_width : Int?
thumbnail_height : Int?
}

Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

#
InlineQueryResultVenue::new

fn InlineQueryResultVenue::new(id~ : String, latitude~ : Double, longitude~ : Double, title~ : String, address~ : String, type_? : String, foursquare_id? : String, foursquare_type? : String, google_place_id? : String, google_place_type? : String, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputTextMessageContent, thumbnail_url? : String, thumbnail_width? : Int, thumbnail_height? : Int) -> InlineQueryResultVenue

Creates a new [InlineQueryResultVenue].

#
InlineQueryResultVideo

pub struct InlineQueryResultVideo {
type_ : String
id : String
video_url : String
mime_type : String
thumbnail_url : String
title : String
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
show_caption_above_media : Bool?
video_width : Int?
video_height : Int?
video_duration : Int?
description : String?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputTextMessageContent?
}

Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

#
InlineQueryResultVideo::new

fn InlineQueryResultVideo::new(id~ : String, video_url~ : String, mime_type~ : String, thumbnail_url~ : String, title~ : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], show_caption_above_media? : Bool, video_width? : Int, video_height? : Int, video_duration? : Int, description? : String, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputTextMessageContent) -> InlineQueryResultVideo

Creates a new [InlineQueryResultVideo].

#
InlineQueryResultVoice

pub struct InlineQueryResultVoice {
type_ : String
id : String
voice_url : String
title : String
caption : String?
parse_mode : String?
caption_entities : Array[MessageEntity]?
voice_duration : Int?
reply_markup : InlineKeyboardMarkup?
input_message_content : InputMessageContentPlaceholder?
}

Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

#
InlineQueryResultVoice::new

fn InlineQueryResultVoice::new(id~ : String, voice_url~ : String, title~ : String, caption? : String, parse_mode? : String, caption_entities? : Array[MessageEntity], voice_duration? : Int, reply_markup? : InlineKeyboardMarkup, input_message_content? : InputMessageContentPlaceholder) -> InlineQueryResultVoice

Creates a new [InlineQueryResultVoice].

#
InlineQueryResultsButton

pub struct InlineQueryResultsButton {
text : String
web_app : WebAppInfo?
start_parameter : String?
}

Represents a button to be shown above inline query results. You must use exactly one of the optional fields.

#
InlineQueryResultsButton::new

fn InlineQueryResultsButton::new(text~ : String, web_app? : WebAppInfo, start_parameter? : String) -> InlineQueryResultsButton

Creates a new [InlineQueryResultsButton].

#
InputChecklist

pub struct InputChecklist {
header : String
tasks : Array[InputChecklistTask]
}

Describes a checklist to create.

#
InputChecklist::new

fn InputChecklist::new(header~ : String, tasks~ : Array[InputChecklistTask]) -> InputChecklist

Creates a new [InputChecklist].

#
InputChecklistTask

pub struct InputChecklistTask {
text : String
}

Describes a task to add to a checklist.

#
InputChecklistTask::new

fn InputChecklistTask::new(text~ : String) -> InputChecklistTask

Creates a new [InputChecklistTask].

#
InputContactMessageContent

pub struct InputContactMessageContent {
phone_number : String
first_name : String
last_name : String?
vcard : String?
}

Represents the content of a contact message to be sent as the result of an inline query.

#
InputContactMessageContent::new

fn InputContactMessageContent::new(phone_number~ : String, first_name~ : String, last_name? : String, vcard? : String) -> InputContactMessageContent

Creates a new [InputContactMessageContent].

#
InputInvoiceMessageContent

pub struct InputInvoiceMessageContent {
title : String
description : String
payload : String
provider_token : String?
currency : String
prices : Array[LabeledPrice]
max_tip_amount : Int?
suggested_tip_amounts : Array[Int]?
provider_data : String?
photo_url : String?
photo_size : Int?
photo_width : Int?
photo_height : Int?
need_name : Bool?
need_phone_number : Bool?
need_email : Bool?
need_shipping_address : Bool?
send_phone_number_to_provider : Bool?
send_email_to_provider : Bool?
is_flexible : Bool?
}

Represents the content of an invoice message to be sent as the result of an inline query.

#
InputInvoiceMessageContent::new

fn InputInvoiceMessageContent::new(title~ : String, description~ : String, payload~ : String, provider_token? : String, currency~ : String, prices~ : Array[LabeledPrice], max_tip_amount? : Int, suggested_tip_amounts? : Array[Int], provider_data? : String, photo_url? : String, photo_size? : Int, photo_width? : Int, photo_height? : Int, need_name? : Bool, need_phone_number? : Bool, need_email? : Bool, need_shipping_address? : Bool, send_phone_number_to_provider? : Bool, send_email_to_provider? : Bool, is_flexible? : Bool) -> InputInvoiceMessageContent

Creates a new [InputInvoiceMessageContent].

#
InputLocationMessageContent

pub struct InputLocationMessageContent {
latitude : Double
longitude : Double
horizontal_accuracy : Double?
live_period : Int?
heading : Int?
proximity_alert_radius : Int?
}

Represents the content of a location message to be sent as the result of an inline query.

#
InputLocationMessageContent::new

fn InputLocationMessageContent::new(latitude~ : Double, longitude~ : Double, horizontal_accuracy? : Double, live_period? : Int, heading? : Int, proximity_alert_radius? : Int) -> InputLocationMessageContent

Creates a new [InputLocationMessageContent].

#
InputMessageContent

Represents the content of a message to be sent as a result of an inline query.

#
InputMessageContentPlaceholder

pub struct InputMessageContentPlaceholder {
message_text : String
}

Placeholder for the InputMessageContent type.

#
InputMessageContentPlaceholder::new

Creates a new [InputMessageContentPlaceholder].

#
InputPollOption

pub struct InputPollOption {
text : String
text_parse_mode : String?
text_entities : Array[MessageEntity]?
}

Contains information about one answer option in a poll to be sent.

#
InputPollOption::new

fn InputPollOption::new(text~ : String, text_parse_mode? : String, text_entities? : Array[MessageEntity]) -> InputPollOption

Creates a new [InputPollOption].

#
InputSticker

pub struct InputSticker {
sticker : String
format : String
emoji_list : Array[String]
mask_position : MaskPosition?
keywords : Array[String]?
}

Describes a sticker to be added to a sticker set.
impl Eq for InputSticker

#
InputSticker::new

fn InputSticker::new(sticker~ : String, format~ : String, emoji_list~ : Array[String], mask_position? : MaskPosition, keywords? : Array[String]) -> InputSticker

Creates a new [InputSticker].

#
InputTextMessageContent

pub struct InputTextMessageContent {
message_text : String
parse_mode : String?
entities : Array[MessageEntity]?
link_preview_options : LinkPreviewOptions?
}

Represents the content of a text message to be sent as the result of an inline query.

#
InputTextMessageContent::new

fn InputTextMessageContent::new(message_text~ : String, parse_mode? : String, entities? : Array[MessageEntity], link_preview_options? : LinkPreviewOptions) -> InputTextMessageContent

Creates a new [InputTextMessageContent].

#
InputVenueMessageContent

pub struct InputVenueMessageContent {
latitude : Double
longitude : Double
title : String
address : String
foursquare_id : String?
foursquare_type : String?
google_place_id : String?
google_place_type : String?
}

Represents the content of a venue message to be sent as the result of an inline query.

#
InputVenueMessageContent::new

fn InputVenueMessageContent::new(latitude~ : Double, longitude~ : Double, title~ : String, address~ : String, foursquare_id? : String, foursquare_type? : String, google_place_id? : String, google_place_type? : String) -> InputVenueMessageContent

Creates a new [InputVenueMessageContent].

#
Invoice

pub struct Invoice {
title : String
description : String
start_parameter : String
currency : String
total_amount : Int
}

This object contains basic information about an invoice.
impl Eq for Invoice
impl Show for Invoice
impl ToJson for Invoice

#
Invoice::new

fn Invoice::new(title~ : String, description~ : String, start_parameter~ : String, currency~ : String, total_amount~ : Int) -> Invoice

Creates a new [Invoice].

#
KeyboardButton

pub struct KeyboardButton {
text : String
request_users : KeyboardButtonRequestUsers?
request_chat : KeyboardButtonRequestChat?
request_contact : Bool?
request_location : Bool?
request_poll : KeyboardButtonPollType?
web_app : WebAppInfo?
}

This object represents one button of the reply keyboard.

#
KeyboardButton::new

fn KeyboardButton::new(text~ : String, request_users? : KeyboardButtonRequestUsers, request_chat? : KeyboardButtonRequestChat, request_contact? : Bool, request_location? : Bool, request_poll? : KeyboardButtonPollType, web_app? : WebAppInfo) -> KeyboardButton

Creates a new [KeyboardButton].

#
KeyboardButtonPollType

pub struct KeyboardButtonPollType {
type_ : String?
}

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

#
KeyboardButtonPollType::new

Creates a new [KeyboardButtonPollType].

#
KeyboardButtonRequestChat

pub struct KeyboardButtonRequestChat {
request_id : Int
chat_is_channel : Bool
chat_is_forum : Bool?
chat_has_username : Bool?
chat_is_created : Bool?
bot_is_member : Bool?
request_title : Bool?
request_username : Bool?
request_photo : Bool?
}

This object defines the criteria used to request a suitable chat.

#
KeyboardButtonRequestChat::new

fn KeyboardButtonRequestChat::new(request_id~ : Int, chat_is_channel~ : Bool, chat_is_forum? : Bool, chat_has_username? : Bool, chat_is_created? : Bool, bot_is_member? : Bool, request_title? : Bool, request_username? : Bool, request_photo? : Bool) -> KeyboardButtonRequestChat

Creates a new [KeyboardButtonRequestChat].

#
KeyboardButtonRequestUsers

pub struct KeyboardButtonRequestUsers {
request_id : Int
user_is_bot : Bool?
user_is_premium : Bool?
max_quantity : Int?
request_name : Bool?
request_username : Bool?
request_photo : Bool?
}

This object defines the criteria used to request suitable users.

#
KeyboardButtonRequestUsers::new

fn KeyboardButtonRequestUsers::new(request_id~ : Int, user_is_bot? : Bool, user_is_premium? : Bool, max_quantity? : Int, request_name? : Bool, request_username? : Bool, request_photo? : Bool) -> KeyboardButtonRequestUsers

Creates a new [KeyboardButtonRequestUsers].

#
LabeledPrice

pub struct LabeledPrice {
label : String
amount : Int
}

This object represents a portion of the price for goods or services.
impl Eq for LabeledPrice

#
LabeledPrice::new

fn LabeledPrice::new(label~ : String, amount~ : Int) -> LabeledPrice

Creates a new [LabeledPrice].

#
LinkPreviewOptions

pub struct LinkPreviewOptions {
is_disabled : Bool?
url : String?
prefer_small_media : Bool?
prefer_large_media : Bool?
show_above_text : Bool?
}

Describes the options used for link preview generation.

#
LinkPreviewOptions::new

fn LinkPreviewOptions::new(is_disabled? : Bool, url? : String, prefer_small_media? : Bool, prefer_large_media? : Bool, show_above_text? : Bool) -> LinkPreviewOptions

Creates a new [LinkPreviewOptions].

#
LinkPreviewPlaceholder

pub struct LinkPreviewPlaceholder {
is_disabled : Bool?
}

Placeholder for the LinkPreviewOptions type.

#
LinkPreviewPlaceholder::new

fn LinkPreviewPlaceholder::new(is_disabled? : Bool) -> LinkPreviewPlaceholder

Creates a new [LinkPreviewPlaceholder].

#
Location

pub struct Location {
latitude : Double
longitude : Double
horizontal_accuracy : Double?
live_period : Int?
heading : Int?
proximity_alert_radius : Int?
}

Represents a point on the map.
impl Eq for Location
impl Show for Location
impl ToJson for Location

#
Location::new

fn Location::new(latitude~ : Double, longitude~ : Double, horizontal_accuracy? : Double, live_period? : Int, heading? : Int, proximity_alert_radius? : Int) -> Location

Creates a new [Location].

#
LoginUrl

pub struct LoginUrl {
url : String
forward_text : String?
bot_username : String?
request_write_access : Bool?
}

This object represents a parameter of the inline keyboard button used to automatically authorize a user.
impl Eq for LoginUrl
impl Show for LoginUrl
impl ToJson for LoginUrl

#
LoginUrl::new

fn LoginUrl::new(url~ : String, forward_text? : String, bot_username? : String, request_write_access? : Bool) -> LoginUrl

Creates a new [LoginUrl].

#
MaskPosition

pub struct MaskPosition {
point : String
x_shift : Double
y_shift : Double
scale : Double
}

Describes the position on faces where a mask should be placed by default.
impl Eq for MaskPosition

#
MaskPosition::new

fn MaskPosition::new(point~ : String, x_shift~ : Double, y_shift~ : Double, scale~ : Double) -> MaskPosition

Creates a new [MaskPosition].

#
Message

pub struct Message {
message_id : Int
from : User?
date : Int
chat : Chat
text : String?
entities : Array[MessageEntity]?
reply_to_message : Message?
message_thread_id : Int?
is_topic_message : Bool?
direct_messages_topic : DirectMessagesTopic?
gift_upgrade_sent : GiftInfo?
gift_id : String?
is_from_blockchain : Bool?
}

This object represents a message.
impl Eq for Message
impl Show for Message
impl ToJson for Message

#
Message::new

fn Message::new(message_id~ : Int, from? : User, date~ : Int, chat~ : Chat, text? : String, entities? : Array[MessageEntity], reply_to_message? : Message, message_thread_id? : Int, is_topic_message? : Bool, direct_messages_topic? : DirectMessagesTopic, gift_upgrade_sent? : GiftInfo, gift_id? : String, is_from_blockchain? : Bool) -> Message

Creates a new [Message].

#
MessageAutoDeleteTimerChanged

pub struct MessageAutoDeleteTimerChanged {
message_auto_delete_time : Int
}

Represents a service message about a change in auto-delete timer settings.

#
MessageAutoDeleteTimerChanged::new

fn MessageAutoDeleteTimerChanged::new(message_auto_delete_time~ : Int) -> MessageAutoDeleteTimerChanged

Creates a new [MessageAutoDeleteTimerChanged].

#
MessageEntity

pub struct MessageEntity {
type_ : String
offset : Int
length : Int
url : String?
user : User?
language : String?
}

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
impl Eq for MessageEntity

#
MessageEntity::new

fn MessageEntity::new(type_~ : String, offset~ : Int, length~ : Int, url? : String, user? : User, language? : String) -> MessageEntity

Creates a new [MessageEntity].

#
MessageId

pub struct MessageId {
message_id : Int
}

This object represents a unique message identifier.
impl Eq for MessageId
impl Show for MessageId
impl ToJson for MessageId

#
MessageId::new

fn MessageId::new(message_id~ : Int) -> MessageId

Creates a new [MessageId].

#
MessageOrigin

pub(all) enum MessageOrigin {
User(MessageOriginUser)
HiddenUser(MessageOriginHiddenUser)
Chat(MessageOriginChat)
Channel(MessageOriginChannel)
}

Placeholder for the MessageOrigin type.
impl Eq for MessageOrigin

#
MessageOriginChannel

pub struct MessageOriginChannel {
date : Int
chat : Chat
message_id : Int
author_signature : String?
}

The message was originally sent to a channel chat.

#
MessageOriginChannel::new

fn MessageOriginChannel::new(date~ : Int, chat~ : Chat, message_id~ : Int, author_signature? : String) -> MessageOriginChannel

Creates a new [MessageOriginChannel].

#
MessageOriginChat

pub struct MessageOriginChat {
date : Int
sender_chat : Chat
author_signature : String?
}

The message was originally sent on behalf of a chat to a group chat.

#
MessageOriginChat::new

fn MessageOriginChat::new(date~ : Int, sender_chat~ : Chat, author_signature? : String) -> MessageOriginChat

Creates a new [MessageOriginChat].

#
MessageOriginHiddenUser

pub struct MessageOriginHiddenUser {
date : Int
sender_user_name : String
}

The message was originally sent by an unknown user.

#
MessageOriginHiddenUser::new

fn MessageOriginHiddenUser::new(date~ : Int, sender_user_name~ : String) -> MessageOriginHiddenUser

Creates a new [MessageOriginHiddenUser].

#
MessageOriginPlaceholder

pub struct MessageOriginPlaceholder {
type_ : String
date : Int
}

Placeholder for the MessageOrigin type.

#
MessageOriginPlaceholder::new

fn MessageOriginPlaceholder::new(type_~ : String, date~ : Int) -> MessageOriginPlaceholder

Creates a new [MessageOriginPlaceholder].

#
MessageOriginUser

pub struct MessageOriginUser {
date : Int
sender_user : User
}

The message was originally sent by a known user.

#
MessageOriginUser::new

fn MessageOriginUser::new(date~ : Int, sender_user~ : User) -> MessageOriginUser

Creates a new [MessageOriginUser].

#
OrderInfo

pub struct OrderInfo {
name : String?
phone_number : String?
email : String?
shipping_address : ShippingAddress?
}

This object represents information about an order.
impl Eq for OrderInfo
impl Show for OrderInfo
impl ToJson for OrderInfo

#
OrderInfo::new

fn OrderInfo::new(name? : String, phone_number? : String, email? : String, shipping_address? : ShippingAddress) -> OrderInfo

Creates a new [OrderInfo].

#
PaidMedia

pub(all) enum PaidMedia {
Preview(PaidMediaPreview)
Photo(PaidMediaPhoto)
Video(PaidMediaVideo)
}

This object describes paid media. Currently, it can be one of PaidMediaPreview, PaidMediaPhoto, or PaidMediaVideo.
impl Eq for PaidMedia
impl Show for PaidMedia
impl ToJson for PaidMedia

#
PaidMediaInfo

pub struct PaidMediaInfo {
star_count : Int
paid_media : Array[PaidMedia]
}

Describes the paid media added to a message.
impl Eq for PaidMediaInfo

#
PaidMediaInfo::new

fn PaidMediaInfo::new(star_count~ : Int, paid_media~ : Array[PaidMedia]) -> PaidMediaInfo

Creates a new [PaidMediaInfo].

#
PaidMediaPhoto

pub struct PaidMediaPhoto {
photo : Array[PhotoSize]
}

The paid media is a photo.

#
PaidMediaPhoto::new

Creates a new [PaidMediaPhoto].

#
PaidMediaPreview

pub struct PaidMediaPreview {
width : Int?
height : Int?
duration : Int?
}

The paid media isn't available before the payment.

#
PaidMediaPreview::new

fn PaidMediaPreview::new(width? : Int, height? : Int, duration? : Int) -> PaidMediaPreview

Creates a new [PaidMediaPreview].

#
PaidMediaVideo

pub struct PaidMediaVideo {
video : Video
}

The paid media is a video.

#
PaidMediaVideo::new

fn PaidMediaVideo::new(video~ : Video) -> PaidMediaVideo

Creates a new [PaidMediaVideo].

#
PassportData

pub struct PassportData {
data : Array[EncryptedPassportElement]
credentials : EncryptedCredentials
}

Describes Telegram Passport data shared with the bot by the user.
impl Eq for PassportData

#
PassportData::new

Creates a new [PassportData].

#
PassportElementError

This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user.

#
PassportElementErrorDataField

pub struct PassportElementErrorDataField {
type_ : String
field_name : String
data_hash : String
message : String
}

Represents an issue in one of the data fields that was provided by the user.

#
PassportElementErrorDataField::new

fn PassportElementErrorDataField::new(type_~ : String, field_name~ : String, data_hash~ : String, message~ : String) -> PassportElementErrorDataField

Creates a new [PassportElementErrorDataField].

#
PassportElementErrorFile

pub struct PassportElementErrorFile {
type_ : String
file_hash : String
message : String
}

Represents an issue with a document scan.

#
PassportElementErrorFile::new

fn PassportElementErrorFile::new(type_~ : String, file_hash~ : String, message~ : String) -> PassportElementErrorFile

Creates a new [PassportElementErrorFile].

#
PassportElementErrorFiles

pub struct PassportElementErrorFiles {
type_ : String
file_hashes : Array[String]
message : String
}

Represents an issue with a list of scans.

#
PassportElementErrorFiles::new

fn PassportElementErrorFiles::new(type_~ : String, file_hashes~ : Array[String], message~ : String) -> PassportElementErrorFiles

Creates a new [PassportElementErrorFiles].

#
PassportElementErrorFrontSide

pub struct PassportElementErrorFrontSide {
type_ : String
file_hash : String
message : String
}

Represents an issue with the front side of a document.

#
PassportElementErrorFrontSide::new

fn PassportElementErrorFrontSide::new(type_~ : String, file_hash~ : String, message~ : String) -> PassportElementErrorFrontSide

Creates a new [PassportElementErrorFrontSide].

#
PassportElementErrorReverseSide

pub struct PassportElementErrorReverseSide {
type_ : String
file_hash : String
message : String
}

Represents an issue with the reverse side of a document.

#
PassportElementErrorReverseSide::new

fn PassportElementErrorReverseSide::new(type_~ : String, file_hash~ : String, message~ : String) -> PassportElementErrorReverseSide

Creates a new [PassportElementErrorReverseSide].

#
PassportElementErrorSelfie

pub struct PassportElementErrorSelfie {
type_ : String
file_hash : String
message : String
}

Represents an issue with the selfie with a document.

#
PassportElementErrorSelfie::new

fn PassportElementErrorSelfie::new(type_~ : String, file_hash~ : String, message~ : String) -> PassportElementErrorSelfie

Creates a new [PassportElementErrorSelfie].

#
PassportElementErrorTranslationFile

pub struct PassportElementErrorTranslationFile {
type_ : String
file_hash : String
message : String
}

Represents an issue with one of the files that constitute the translation of a document.

#
PassportElementErrorTranslationFile::new

fn PassportElementErrorTranslationFile::new(type_~ : String, file_hash~ : String, message~ : String) -> PassportElementErrorTranslationFile

Creates a new [PassportElementErrorTranslationFile].

#
PassportElementErrorTranslationFiles

pub struct PassportElementErrorTranslationFiles {
type_ : String
file_hashes : Array[String]
message : String
}

Represents an issue with the translated version of a document.

#
PassportElementErrorTranslationFiles::new

fn PassportElementErrorTranslationFiles::new(type_~ : String, file_hashes~ : Array[String], message~ : String) -> PassportElementErrorTranslationFiles

Creates a new [PassportElementErrorTranslationFiles].

#
PassportElementErrorUnspecified

pub struct PassportElementErrorUnspecified {
type_ : String
element_hash : String
message : String
}

Represents an issue in an unspecified place.

#
PassportElementErrorUnspecified::new

fn PassportElementErrorUnspecified::new(type_~ : String, element_hash~ : String, message~ : String) -> PassportElementErrorUnspecified

Creates a new [PassportElementErrorUnspecified].

#
PassportFile

pub struct PassportFile {
file_id : String
file_unique_id : String
file_size : Int64
file_date : Int
}

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
impl Eq for PassportFile

#
PassportFile::new

fn PassportFile::new(file_id~ : String, file_unique_id~ : String, file_size~ : Int64, file_date~ : Int) -> PassportFile

Creates a new [PassportFile].

#
PhotoSize

pub struct PhotoSize {
file_id : String
file_unique_id : String
width : Int
height : Int
file_size : Int64?
}

Represents one size of a photo or a file/sticker thumbnail.
impl Eq for PhotoSize
impl Show for PhotoSize
impl ToJson for PhotoSize

#
PhotoSize::new

fn PhotoSize::new(file_id~ : String, file_unique_id~ : String, width~ : Int, height~ : Int, file_size? : Int64) -> PhotoSize

Creates a new [PhotoSize].

#
Poll

pub struct Poll {
id : String
question : String
question_entities : Array[MessageEntity]?
options : Array[PollOption]
total_voter_count : Int
is_closed : Bool
is_anonymous : Bool
type_ : String
allows_multiple_answers : Bool
correct_option_id : Int?
explanation : String?
explanation_entities : Array[MessageEntity]?
open_period : Int?
close_date : Int?
}

Contains information about a poll.
impl Eq for Poll
impl Show for Poll
impl ToJson for Poll

#
Poll::new

fn Poll::new(id~ : String, question~ : String, question_entities? : Array[MessageEntity], options~ : Array[PollOption], total_voter_count~ : Int, is_closed~ : Bool, is_anonymous~ : Bool, type_~ : String, allows_multiple_answers~ : Bool, correct_option_id? : Int, explanation? : String, explanation_entities? : Array[MessageEntity], open_period? : Int, close_date? : Int) -> Poll

Creates a new [Poll].

#
PollAnswer

pub struct PollAnswer {
poll_id : String
voter_chat : Chat?
user : User?
option_ids : Array[Int]
}

Represents an answer of a user in a non-anonymous poll.
impl Eq for PollAnswer
impl Show for PollAnswer

#
PollAnswer::new

fn PollAnswer::new(poll_id~ : String, voter_chat? : Chat, user? : User, option_ids~ : Array[Int]) -> PollAnswer

Creates a new [PollAnswer].

#
PollOption

pub struct PollOption {
text : String
text_entities : Array[MessageEntity]?
voter_count : Int
}

Contains information about one answer option in a poll.
impl Eq for PollOption
impl Show for PollOption

#
PollOption::new

fn PollOption::new(text~ : String, text_entities? : Array[MessageEntity], voter_count~ : Int) -> PollOption

Creates a new [PollOption].

#
ProximityAlertTriggered

pub struct ProximityAlertTriggered {
traveler : User
watcher : User
distance : Int
}

Represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

#
ProximityAlertTriggered::new

fn ProximityAlertTriggered::new(traveler~ : User, watcher~ : User, distance~ : Int) -> ProximityAlertTriggered

Creates a new [ProximityAlertTriggered].

#
ReactionType

pub(all) enum ReactionType {
Emoji(ReactionTypeEmoji)
CustomEmoji(ReactionTypeCustomEmoji)
}

Describes the type of a reaction. Currently, it can be one of ReactionTypeEmoji or ReactionTypeCustomEmoji.
impl Eq for ReactionType

#
ReactionTypeCustomEmoji

pub struct ReactionTypeCustomEmoji {
custom_emoji_id : String
}

The reaction is based on a custom emoji.

#
ReactionTypeCustomEmoji::new

fn ReactionTypeCustomEmoji::new(custom_emoji_id~ : String) -> ReactionTypeCustomEmoji

Creates a new [ReactionTypeCustomEmoji].

#
ReactionTypeEmoji

pub struct ReactionTypeEmoji {
emoji : String
}

The reaction is based on an emoji.

#
ReactionTypeEmoji::new

fn ReactionTypeEmoji::new(emoji~ : String) -> ReactionTypeEmoji

Creates a new [ReactionTypeEmoji].

#
RefundedPayment

pub struct RefundedPayment {
currency : String
total_amount : Int
invoice_payload : String
telegram_payment_charge_id : String
provider_payment_charge_id : String?
}

This object contains basic information about a refunded payment.

#
RefundedPayment::new

fn RefundedPayment::new(currency~ : String, total_amount~ : Int, invoice_payload~ : String, telegram_payment_charge_id~ : String, provider_payment_charge_id? : String) -> RefundedPayment

Creates a new [RefundedPayment].

#
ReplyKeyboardMarkup

pub struct ReplyKeyboardMarkup {
keyboard : Array[Array[KeyboardButton]]
is_persistent : Bool?
resize_keyboard : Bool?
one_time_keyboard : Bool?
input_field_placeholder : String?
selective : Bool?
}

This object represents a custom keyboard with reply options.

#
ReplyKeyboardMarkup::new

fn ReplyKeyboardMarkup::new(keyboard~ : Array[Array[KeyboardButton]], is_persistent? : Bool, resize_keyboard? : Bool, one_time_keyboard? : Bool, input_field_placeholder? : String, selective? : Bool) -> ReplyKeyboardMarkup

Creates a new [ReplyKeyboardMarkup].

#
ReplyKeyboardRemove

pub struct ReplyKeyboardRemove {
remove_keyboard : Bool
selective : Bool?
}

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard.

#
ReplyKeyboardRemove::new

fn ReplyKeyboardRemove::new(remove_keyboard~ : Bool, selective? : Bool) -> ReplyKeyboardRemove

Creates a new [ReplyKeyboardRemove].

#
ReplyParameters

pub struct ReplyParameters {
message_id : Int
chat_id : ChatId?
allow_sending_without_reply : Bool?
quote : String?
quote_parse_mode : String?
quote_entities : Array[MessageEntity]?
quote_position : Int?
}

Describes reply parameters for the message that is being sent.

#
ReplyParameters::new

fn ReplyParameters::new(message_id~ : Int, chat_id? : ChatId, allow_sending_without_reply? : Bool, quote? : String, quote_parse_mode? : String, quote_entities? : Array[MessageEntity], quote_position? : Int) -> ReplyParameters

Creates a new [ReplyParameters].

#
SentWebAppMessage

pub struct SentWebAppMessage {
inline_message_id : String?
}

Describes an inline message sent by a Web App on behalf of a user.

#
SentWebAppMessage::new

fn SentWebAppMessage::new(inline_message_id? : String) -> SentWebAppMessage

Creates a new [SentWebAppMessage].

#
SharedUser

pub struct SharedUser {
user_id : Int64
first_name : String?
last_name : String?
username : String?
photo : Array[PhotoSize]?
}

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
impl Eq for SharedUser
impl Show for SharedUser

#
SharedUser::new

fn SharedUser::new(user_id~ : Int64, first_name? : String, last_name? : String, username? : String, photo? : Array[PhotoSize]) -> SharedUser

Creates a new [SharedUser].

#
ShippingAddress

pub struct ShippingAddress {
country_code : String
state : String
city : String
street_line1 : String
street_line2 : String
post_code : String
}

This object represents a shipping address.

#
ShippingAddress::new

fn ShippingAddress::new(country_code~ : String, state~ : String, city~ : String, street_line1~ : String, street_line2~ : String, post_code~ : String) -> ShippingAddress

Creates a new [ShippingAddress].

#
ShippingOption

pub struct ShippingOption {
id : String
title : String
prices : Array[LabeledPrice]
}

This object represents one shipping option.

#
ShippingOption::new

fn ShippingOption::new(id~ : String, title~ : String, prices~ : Array[LabeledPrice]) -> ShippingOption

Creates a new [ShippingOption].

#
StarBalance

pub struct StarBalance {
balance : Int
}

Describes the current Telegram Star balance of a business account.
impl Eq for StarBalance
impl Show for StarBalance

#
StarBalance::new

fn StarBalance::new(balance~ : Int) -> StarBalance

Creates a new [StarBalance].

#
Sticker

pub struct Sticker {
file_id : String
file_unique_id : String
type_ : String
width : Int
height : Int
is_animated : Bool
is_video : Bool
thumbnail : PhotoSize?
emoji : String?
set_name : String?
premium_animation : FilePlaceholder?
mask_position : MaskPosition?
custom_emoji_id : String?
needs_repainting : Bool?
file_size : Int64?
}

Represents a sticker.
impl Eq for Sticker
impl Show for Sticker
impl ToJson for Sticker

#
Sticker::new

fn Sticker::new(file_id~ : String, file_unique_id~ : String, type_~ : String, width~ : Int, height~ : Int, is_animated~ : Bool, is_video~ : Bool, thumbnail? : PhotoSize, emoji? : String, set_name? : String, premium_animation? : FilePlaceholder, mask_position? : MaskPosition, custom_emoji_id? : String, needs_repainting? : Bool, file_size? : Int64) -> Sticker

Creates a new [Sticker].

#
StickerPlaceholder

pub struct StickerPlaceholder {
file_id : String
file_unique_id : String
width : Int
height : Int
}

Placeholder for a sticker object with basic file information.

#
StickerPlaceholder::new

fn StickerPlaceholder::new(file_id~ : String, file_unique_id~ : String, width~ : Int, height~ : Int) -> StickerPlaceholder

Creates a new [StickerPlaceholder].

#
StickerSet

pub struct StickerSet {
name : String
title : String
sticker_type : String
stickers : Array[Sticker]
thumbnail : PhotoSize?
}

Represents a sticker set.
impl Eq for StickerSet
impl Show for StickerSet

#
StickerSet::new

fn StickerSet::new(name~ : String, title~ : String, sticker_type~ : String, stickers~ : Array[Sticker], thumbnail? : PhotoSize) -> StickerSet

Creates a new [StickerSet].

#
Story

pub struct Story {
chat : Chat
id : Int
}

Represents a story.
impl Eq for Story
impl Show for Story
impl ToJson for Story

#
Story::new

fn Story::new(chat~ : Chat, id~ : Int) -> Story

Creates a new [Story].

#
SuccessfulPayment

pub struct SuccessfulPayment {
currency : String
total_amount : Int
invoice_payload : String
shipping_option_id : String?
order_info : OrderInfo?
telegram_payment_charge_id : String
provider_payment_charge_id : String
}

This object contains basic information about a successful payment.

#
SuccessfulPayment::new

fn SuccessfulPayment::new(currency~ : String, total_amount~ : Int, invoice_payload~ : String, shipping_option_id? : String, order_info? : OrderInfo, telegram_payment_charge_id~ : String, provider_payment_charge_id~ : String) -> SuccessfulPayment

Creates a new [SuccessfulPayment].

#
SuggestedPostApprovalFailed

pub struct SuggestedPostApprovalFailed {
user : User
suggested_post_info : SuggestedPostInfo
}

Describes a service message about the failed approval of a suggested post.

#
SuggestedPostApprovalFailed::new

Creates a new [SuggestedPostApprovalFailed].

#
SuggestedPostApproved

pub struct SuggestedPostApproved {
user : User
suggested_post_info : SuggestedPostInfo
}

Describes a service message about the approval of a suggested post.

#
SuggestedPostApproved::new

fn SuggestedPostApproved::new(user~ : User, suggested_post_info~ : SuggestedPostInfo) -> SuggestedPostApproved

Creates a new [SuggestedPostApproved].

#
SuggestedPostDeclined

pub struct SuggestedPostDeclined {
user : User
suggested_post_info : SuggestedPostInfo
}

Describes a service message about the rejection of a suggested post.

#
SuggestedPostDeclined::new

fn SuggestedPostDeclined::new(user~ : User, suggested_post_info~ : SuggestedPostInfo) -> SuggestedPostDeclined

Creates a new [SuggestedPostDeclined].

#
SuggestedPostInfo

pub struct SuggestedPostInfo {
suggested_post_parameters : SuggestedPostParameters?
is_approved : Bool
is_declined : Bool
is_paid : Bool
}

Describes a suggested post in a channel direct messages chat.

#
SuggestedPostInfo::new

fn SuggestedPostInfo::new(suggested_post_parameters? : SuggestedPostParameters, is_approved~ : Bool, is_declined~ : Bool, is_paid~ : Bool) -> SuggestedPostInfo

Creates a new [SuggestedPostInfo].

#
SuggestedPostPaid

pub struct SuggestedPostPaid {
user : User
suggested_post_info : SuggestedPostInfo
}

Describes a service message about a successful payment for a suggested post.

#
SuggestedPostPaid::new

fn SuggestedPostPaid::new(user~ : User, suggested_post_info~ : SuggestedPostInfo) -> SuggestedPostPaid

Creates a new [SuggestedPostPaid].

#
SuggestedPostParameters

pub struct SuggestedPostParameters {
text : String?
link_preview_options : LinkPreviewOptions?
is_disabled : Bool?
}

Describes the parameters of a suggested post.

#
SuggestedPostParameters::new

fn SuggestedPostParameters::new(text? : String, link_preview_options? : LinkPreviewOptions, is_disabled? : Bool) -> SuggestedPostParameters

Creates a new [SuggestedPostParameters].

#
SuggestedPostPrice

pub struct SuggestedPostPrice {
star_count : Int
}

Describes the price of a suggested post.

#
SuggestedPostPrice::new

fn SuggestedPostPrice::new(star_count~ : Int) -> SuggestedPostPrice

Creates a new [SuggestedPostPrice].

#
SwitchInlineQueryChosenChat

pub struct SwitchInlineQueryChosenChat {
query : String?
allow_user_chats : Bool?
allow_bot_chats : Bool?
allow_group_chats : Bool?
allow_channel_chats : Bool?
}

This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.

#
SwitchInlineQueryChosenChat::new

fn SwitchInlineQueryChosenChat::new(query? : String, allow_user_chats? : Bool, allow_bot_chats? : Bool, allow_group_chats? : Bool, allow_channel_chats? : Bool) -> SwitchInlineQueryChosenChat

Creates a new [SwitchInlineQueryChosenChat].

#
TextQuote

pub struct TextQuote {
text : String
entities : Array[MessageEntity]?
position : Int
is_manual : Bool?
}

This object contains information about the quoted part of a message that is replied to by the given message.
impl Eq for TextQuote
impl Show for TextQuote
impl ToJson for TextQuote

#
TextQuote::new

fn TextQuote::new(text~ : String, entities? : Array[MessageEntity], position~ : Int, is_manual? : Bool) -> TextQuote

Creates a new [TextQuote].

#
UniqueGiftColors

pub struct UniqueGiftColors {
background_icon_color : Int
text_color : Int
hint_color : Int
link_color : Int
button_color : Int
button_text_color : Int
}

Describes the colors of a unique gift that determine the color scheme for the user's name, replies to messages, and link previews.

#
UniqueGiftColors::new

fn UniqueGiftColors::new(background_icon_color~ : Int, text_color~ : Int, hint_color~ : Int, link_color~ : Int, button_color~ : Int, button_text_color~ : Int) -> UniqueGiftColors

Creates a new [UniqueGiftColors].

#
UniqueGiftInfo

pub struct UniqueGiftInfo {
next_transfer_date : Int?
last_resale_amount : Int?
origin : String?
gift_id : String
is_from_blockchain : Bool?
}

Describes a service message about a unique gift that was sent or received.

#
UniqueGiftInfo::new

fn UniqueGiftInfo::new(gift_id~ : String, next_transfer_date? : Int, last_resale_amount? : Int, origin? : String, is_from_blockchain? : Bool) -> UniqueGiftInfo

Creates a new [UniqueGiftInfo].

#
Update

pub struct Update {
update_id : Int
message : Message?
edited_message : Message?
callback_query : CallbackQuery?
}

This object represents an incoming update. At most one of the optional parameters can be present in any given update.
impl Eq for Update
impl Show for Update
impl ToJson for Update

#
Update::new

fn Update::new(update_id~ : Int, message? : Message, edited_message? : Message, callback_query? : CallbackQuery) -> Update

Creates a new [Update].

#
User

pub struct User {
id : Int64
is_bot : Bool
first_name : String
last_name : String?
username : String?
language_code : String?
}

This object represents a Telegram user or bot.
impl Eq for User
impl Show for User
impl ToJson for User

#
User::new

fn User::new(id~ : Int64, is_bot~ : Bool, first_name~ : String, last_name? : String, username? : String, language_code? : String) -> User

Creates a new [User].

#
UsersShared

pub struct UsersShared {
request_id : Int
users : Array[SharedUser]
}

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
impl Eq for UsersShared
impl Show for UsersShared

#
UsersShared::new

fn UsersShared::new(request_id~ : Int, users~ : Array[SharedUser]) -> UsersShared

Creates a new [UsersShared].

#
Venue

pub struct Venue {
location : Location
title : String
address : String
foursquare_id : String?
foursquare_type : String?
google_place_id : String?
google_place_type : String?
}

Represents a venue.
impl Eq for Venue
impl Show for Venue
impl ToJson for Venue

#
Venue::new

fn Venue::new(location~ : Location, title~ : String, address~ : String, foursquare_id? : String, foursquare_type? : String, google_place_id? : String, google_place_type? : String) -> Venue

Creates a new [Venue].

#
Video

pub struct Video {
file_id : String
file_unique_id : String
width : Int
height : Int
duration : Int
thumbnail : PhotoSize?
cover : Array[PhotoSize]?
start_timestamp : Int?
file_name : String?
mime_type : String?
file_size : Int64?
}

Represents a video file.
impl Eq for Video
impl Show for Video
impl ToJson for Video

#
Video::new

fn Video::new(file_id~ : String, file_unique_id~ : String, width~ : Int, height~ : Int, duration~ : Int, thumbnail? : PhotoSize, cover? : Array[PhotoSize], start_timestamp? : Int, file_name? : String, mime_type? : String, file_size? : Int64) -> Video

Creates a new [Video].

#
VideoChatEnded

pub struct VideoChatEnded {
duration : Int
}

Represents a service message about a video chat ended in the chat.

#
VideoChatEnded::new

fn VideoChatEnded::new(duration~ : Int) -> VideoChatEnded

Creates a new [VideoChatEnded].

#
VideoChatParticipantsInvited

pub struct VideoChatParticipantsInvited {
users : Array[User]
}

Represents a service message about new members invited to a video chat.

#
VideoChatParticipantsInvited::new

Creates a new [VideoChatParticipantsInvited].

#
VideoChatScheduled

pub struct VideoChatScheduled {
start_date : Int
}

Represents a service message about a video chat scheduled in the chat.

#
VideoChatScheduled::new

fn VideoChatScheduled::new(start_date~ : Int) -> VideoChatScheduled

Creates a new [VideoChatScheduled].

#
VideoChatStarted

pub struct VideoChatStarted {
}

Represents a service message about a video chat started in the chat. Currently holds no information.

#
VideoChatStarted::new

Creates a new [VideoChatStarted].

#
VideoNote

pub struct VideoNote {
file_id : String
file_unique_id : String
length : Int
duration : Int
thumbnail : PhotoSize?
file_size : Int64?
}

Represents a video message (available in Telegram apps as of v.4.0).
impl Eq for VideoNote
impl Show for VideoNote
impl ToJson for VideoNote

#
VideoNote::new

fn VideoNote::new(file_id~ : String, file_unique_id~ : String, length~ : Int, duration~ : Int, thumbnail? : PhotoSize, file_size? : Int64) -> VideoNote

Creates a new [VideoNote].

#
Voice

pub struct Voice {
file_id : String
file_unique_id : String
duration : Int
mime_type : String?
file_size : Int64?
}

Represents a voice note.
impl Eq for Voice
impl Show for Voice
impl ToJson for Voice

#
Voice::new

fn Voice::new(file_id~ : String, file_unique_id~ : String, duration~ : Int, mime_type? : String, file_size? : Int64) -> Voice

Creates a new [Voice].

#
WebAppData

pub struct WebAppData {
data : String
button_text : String
}

Describes data sent from a Web App to the bot.
impl Eq for WebAppData
impl Show for WebAppData

#
WebAppData::new

fn WebAppData::new(data~ : String, button_text~ : String) -> WebAppData

Creates a new [WebAppData].

#
WebAppInfo

pub struct WebAppInfo {
url : String
}

Describes a Web App.
impl Eq for WebAppInfo
impl Show for WebAppInfo

#
WebAppInfo::new

fn WebAppInfo::new(url~ : String) -> WebAppInfo

Creates a new [WebAppInfo].

#
WebhookInfo

pub struct WebhookInfo {
url : String
has_custom_certificate : Bool
pending_update_count : Int
ip_address : String?
last_error_date : Int?
last_error_message : String?
last_synchronization_error_date : Int?
max_connections : Int?
allowed_updates : Array[String]?
}

Describes the current status of a webhook.
impl Eq for WebhookInfo
impl Show for WebhookInfo

#
WebhookInfo::new

fn WebhookInfo::new(url~ : String, has_custom_certificate~ : Bool, pending_update_count~ : Int, ip_address? : String, last_error_date? : Int, last_error_message? : String, last_synchronization_error_date? : Int, max_connections? : Int, allowed_updates? : Array[String]) -> WebhookInfo

Creates a new [WebhookInfo].

#
WriteAccessAllowed

pub struct WriteAccessAllowed {
from_request : Bool?
web_app_name : String?
from_attachment_menu : Bool?
}

Represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App.

#
WriteAccessAllowed::new

fn WriteAccessAllowed::new(from_request? : Bool, web_app_name? : String, from_attachment_menu? : Bool) -> WriteAccessAllowed

Creates a new [WriteAccessAllowed].