telega/model
Types
Official reference: Contains information about the affiliate that received a commission via this transaction.
pub type AffiliateInfo {
AffiliateInfo(
affiliate_user: Option(User),
affiliate_chat: Option(Chat),
commission_per_mille: Int,
amount: Int,
nanostar_amount: Option(Int),
)
}
Constructors
-
AffiliateInfo( affiliate_user: Option(User), affiliate_chat: Option(Chat), commission_per_mille: Int, amount: Int, nanostar_amount: Option(Int), )
Arguments
- affiliate_user
-
Optional. The bot or the user that received an affiliate commission if it was received by a bot or a user
- affiliate_chat
-
Optional. The chat that received an affiliate commission if it was received by a chat
- commission_per_mille
-
The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users
- amount
-
Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds
- nanostar_amount
-
Optional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds
Official reference: This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
pub type Animation {
Animation(
file_id: String,
file_unique_id: String,
width: Int,
height: Int,
duration: Int,
thumbnail: Option(PhotoSize),
file_name: Option(String),
mime_type: Option(String),
file_size: Option(Int),
)
}
Constructors
-
Animation( file_id: String, file_unique_id: String, width: Int, height: Int, duration: Int, thumbnail: Option(PhotoSize), file_name: Option(String), mime_type: Option(String), file_size: Option(Int), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- width
-
Video width as defined by the sender
- height
-
Video height as defined by the sender
- duration
-
Duration of the video in seconds as defined by the sender
- thumbnail
-
Optional. Animation thumbnail as defined by the sender
- file_name
-
Optional. Original animation filename as defined by the sender
- mime_type
-
Optional. MIME type of the file as defined by the sender
- file_size
-
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
pub type AnswerCallbackQueryParameters {
AnswerCallbackQueryParameters(
callback_query_id: String,
text: Option(String),
show_alert: Option(Bool),
url: Option(String),
cache_time: Option(Int),
)
}
Constructors
-
AnswerCallbackQueryParameters( callback_query_id: String, text: Option(String), show_alert: Option(Bool), url: Option(String), cache_time: Option(Int), )
Arguments
- callback_query_id
-
Unique identifier for the query to be answered
- text
-
Text of the notification. If not specified, nothing will be shown to the user
- show_alert
-
If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
- url
-
URL that will be opened by the user’s client. If you have created a Game, you can use this field to redirect the player to your game
- cache_time
-
The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
Official reference: This object represents an audio file to be treated as music by the Telegram clients.
pub type Audio {
Audio(
file_id: String,
file_unique_id: String,
duration: Int,
performer: Option(String),
title: Option(String),
file_name: Option(String),
mime_type: Option(String),
file_size: Option(Int),
thumbnail: Option(PhotoSize),
)
}
Constructors
-
Audio( file_id: String, file_unique_id: String, duration: Int, performer: Option(String), title: Option(String), file_name: Option(String), mime_type: Option(String), file_size: Option(Int), thumbnail: Option(PhotoSize), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- duration
-
Duration of the audio in seconds as defined by the sender
- performer
-
Optional. Performer of the audio as defined by the sender or by audio tags
- title
-
Optional. Title of the audio as defined by the sender or by audio tags
- file_name
-
Optional. Original filename as defined by the sender
- mime_type
-
Optional. MIME type of the file as defined by the sender
- file_size
-
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
- thumbnail
-
Optional. Thumbnail of the album cover to which the music file belongs
pub type BackgroundFill {
BackgroundFillSolidBackgroundFill(BackgroundFillSolid)
BackgroundFillGradientBackgroundFill(BackgroundFillGradient)
BackgroundFillFreeformGradientBackgroundFill(
BackgroundFillFreeformGradient,
)
}
Constructors
-
BackgroundFillSolidBackgroundFill(BackgroundFillSolid)
-
BackgroundFillGradientBackgroundFill(BackgroundFillGradient)
-
BackgroundFillFreeformGradientBackgroundFill( BackgroundFillFreeformGradient, )
Official reference: The background is a freeform gradient that rotates after every message in the chat.
pub type BackgroundFillFreeformGradient {
BackgroundFillFreeformGradient(
type_: String,
colors: List(Int),
)
}
Constructors
-
BackgroundFillFreeformGradient(type_: String, colors: List(Int))
Arguments
- type_
-
Type of the background fill, always “freeform_gradient”
- colors
-
A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format
Official reference: The background is a gradient fill.
pub type BackgroundFillGradient {
BackgroundFillGradient(
type_: String,
top_color: Int,
bottom_color: Int,
rotation_angle: Int,
)
}
Constructors
-
BackgroundFillGradient( type_: String, top_color: Int, bottom_color: Int, rotation_angle: Int, )
Arguments
- type_
-
Type of the background fill, always “gradient”
- top_color
-
Top color of the gradient in the RGB24 format
- bottom_color
-
Bottom color of the gradient in the RGB24 format
- rotation_angle
-
Clockwise rotation angle of the background fill in degrees; 0-359
Official reference: The background is filled using the selected color.
pub type BackgroundFillSolid {
BackgroundFillSolid(type_: String, color: Int)
}
Constructors
-
BackgroundFillSolid(type_: String, color: Int)
Arguments
- type_
-
Type of the background fill, always “solid”
- color
-
The color of the background fill in the RGB24 format
pub type BackgroundType {
BackgroundTypeFillBackgroundType(BackgroundTypeFill)
BackgroundTypeWallpaperBackgroundType(BackgroundTypeWallpaper)
BackgroundTypePatternBackgroundType(BackgroundTypePattern)
BackgroundTypeChatThemeBackgroundType(BackgroundTypeChatTheme)
}
Constructors
-
BackgroundTypeFillBackgroundType(BackgroundTypeFill)
-
BackgroundTypeWallpaperBackgroundType(BackgroundTypeWallpaper)
-
BackgroundTypePatternBackgroundType(BackgroundTypePattern)
-
BackgroundTypeChatThemeBackgroundType(BackgroundTypeChatTheme)
Official reference: The background is taken directly from a built-in chat theme.
pub type BackgroundTypeChatTheme {
BackgroundTypeChatTheme(type_: String, theme_name: String)
}
Constructors
-
BackgroundTypeChatTheme(type_: String, theme_name: String)
Arguments
- type_
-
Type of the background, always “chat_theme”
- theme_name
-
Name of the chat theme, which is usually an emoji
Official reference: The background is automatically filled based on the selected colors.
pub type BackgroundTypeFill {
BackgroundTypeFill(
type_: String,
fill: BackgroundFill,
dark_theme_dimming: Int,
)
}
Constructors
-
BackgroundTypeFill( type_: String, fill: BackgroundFill, dark_theme_dimming: Int, )
Arguments
- type_
-
Type of the background, always “fill”
- fill
-
The background fill
- dark_theme_dimming
-
Dimming of the background in dark themes, as a percentage; 0-100
Official reference: The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
pub type BackgroundTypePattern {
BackgroundTypePattern(
type_: String,
document: Document,
fill: BackgroundFill,
intensity: Int,
is_inverted: Option(Bool),
is_moving: Option(Bool),
)
}
Constructors
-
BackgroundTypePattern( type_: String, document: Document, fill: BackgroundFill, intensity: Int, is_inverted: Option(Bool), is_moving: Option(Bool), )
Arguments
- type_
-
Type of the background, always “pattern”
- document
-
Document with the pattern
- fill
-
The background fill that is combined with the pattern
- intensity
-
Intensity of the pattern when it is shown above the filled background; 0-100
- is_inverted
-
Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
- is_moving
-
Optional. True, if the background moves slightly when the device is tilted
Official reference: The background is a wallpaper in the JPEG format.
pub type BackgroundTypeWallpaper {
BackgroundTypeWallpaper(
type_: String,
document: Document,
dark_theme_dimming: Int,
is_blurred: Option(Bool),
is_moving: Option(Bool),
)
}
Constructors
-
BackgroundTypeWallpaper( type_: String, document: Document, dark_theme_dimming: Int, is_blurred: Option(Bool), is_moving: Option(Bool), )
Arguments
- type_
-
Type of the background, always “wallpaper”
- document
-
Document with the wallpaper
- dark_theme_dimming
-
Dimming of the background in dark themes, as a percentage; 0-100
- is_blurred
-
Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12
- is_moving
-
Optional. True, if the background moves slightly when the device is tilted
Official reference: Describes the birthdate of a user.
pub type Birthdate {
Birthdate(day: Int, month: Int, year: Option(Int))
}
Constructors
-
Birthdate(day: Int, month: Int, year: Option(Int))
Arguments
- day
-
Day of the user’s birth; 1-31
- month
-
Month of the user’s birth; 1-12
- year
-
Optional. Year of the user’s birth
Official reference: This object represents a bot command.
pub type BotCommand {
BotCommand(command: String, description: String)
}
Constructors
-
BotCommand(command: String, description: String)
Arguments
- command
-
Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
- description
-
Description of the command; 1-256 characters.
pub type BotCommandParameters {
BotCommandParameters(
scope: Option(BotCommandScope),
language_code: Option(String),
)
}
Constructors
-
BotCommandParameters( scope: Option(BotCommandScope), language_code: Option(String), )
Arguments
- scope
-
An object, describing scope of users for which the commands are relevant. Defaults to
BotCommandScopeDefault
. - language_code
-
A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
pub type BotCommandScope {
BotCommandScopeDefaultBotCommandScope(BotCommandScopeDefault)
BotCommandScopeAllPrivateChatsBotCommandScope(
BotCommandScopeAllPrivateChats,
)
BotCommandScopeAllGroupChatsBotCommandScope(
BotCommandScopeAllGroupChats,
)
BotCommandScopeAllChatAdministratorsBotCommandScope(
BotCommandScopeAllChatAdministrators,
)
BotCommandScopeChatBotCommandScope(BotCommandScopeChat)
BotCommandScopeChatAdministratorsBotCommandScope(
BotCommandScopeChatAdministrators,
)
BotCommandScopeChatMemberBotCommandScope(
BotCommandScopeChatMember,
)
}
Constructors
-
BotCommandScopeDefaultBotCommandScope(BotCommandScopeDefault)
-
BotCommandScopeAllPrivateChatsBotCommandScope( BotCommandScopeAllPrivateChats, )
-
BotCommandScopeAllGroupChatsBotCommandScope( BotCommandScopeAllGroupChats, )
-
BotCommandScopeAllChatAdministratorsBotCommandScope( BotCommandScopeAllChatAdministrators, )
-
BotCommandScopeChatBotCommandScope(BotCommandScopeChat)
-
BotCommandScopeChatAdministratorsBotCommandScope( BotCommandScopeChatAdministrators, )
-
BotCommandScopeChatMemberBotCommandScope( BotCommandScopeChatMember, )
Official reference: Represents the scope of bot commands, covering all group and supergroup chat administrators.
pub type BotCommandScopeAllChatAdministrators {
BotCommandScopeAllChatAdministrators(type_: String)
}
Constructors
-
BotCommandScopeAllChatAdministrators(type_: String)
Arguments
- type_
-
Scope type, must be all_chat_administrators
Official reference: Represents the scope of bot commands, covering all group and supergroup chats.
pub type BotCommandScopeAllGroupChats {
BotCommandScopeAllGroupChats(type_: String)
}
Constructors
-
BotCommandScopeAllGroupChats(type_: String)
Arguments
- type_
-
Scope type, must be all_group_chats
Official reference: Represents the scope of bot commands, covering all private chats.
pub type BotCommandScopeAllPrivateChats {
BotCommandScopeAllPrivateChats(type_: String)
}
Constructors
-
BotCommandScopeAllPrivateChats(type_: String)
Arguments
- type_
-
Scope type, must be all_private_chats
Official reference: Represents the scope of bot commands, covering a specific chat.
pub type BotCommandScopeChat {
BotCommandScopeChat(type_: String, chat_id: IntOrString)
}
Constructors
-
BotCommandScopeChat(type_: String, chat_id: IntOrString)
Arguments
- type_
-
Scope type, must be chat
- chat_id
-
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Official reference: Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
pub type BotCommandScopeChatAdministrators {
BotCommandScopeChatAdministrators(
type_: String,
chat_id: IntOrString,
)
}
Constructors
-
BotCommandScopeChatAdministrators( type_: String, chat_id: IntOrString, )
Arguments
- type_
-
Scope type, must be chat_administrators
- chat_id
-
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Official reference: Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
pub type BotCommandScopeChatMember {
BotCommandScopeChatMember(
type_: String,
chat_id: IntOrString,
user_id: Int,
)
}
Constructors
-
BotCommandScopeChatMember( type_: String, chat_id: IntOrString, user_id: Int, )
Arguments
- type_
-
Scope type, must be chat_member
- chat_id
-
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- user_id
-
Unique identifier of the target user
Official reference: Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
pub type BotCommandScopeDefault {
BotCommandScopeDefault(type_: String)
}
Constructors
-
BotCommandScopeDefault(type_: String)
Arguments
- type_
-
Scope type, must be default
Official reference: This object represents the bot’s description.
pub type BotDescription {
BotDescription(description: String)
}
Constructors
-
BotDescription(description: String)
Arguments
- description
-
The bot’s description
Official reference: This object represents the bot’s name.
pub type BotName {
BotName(name: String)
}
Constructors
-
BotName(name: String)
Arguments
- name
-
The bot’s name
Official reference: This object represents the bot’s short description.
pub type BotShortDescription {
BotShortDescription(short_description: String)
}
Constructors
-
BotShortDescription(short_description: String)
Arguments
- short_description
-
The bot’s short description
Official reference: Describes the connection of the bot with a business account.
pub type BusinessConnection {
BusinessConnection(
id: String,
user: User,
user_chat_id: Int,
date: Int,
can_reply: Bool,
is_enabled: Bool,
)
}
Constructors
-
BusinessConnection( id: String, user: User, user_chat_id: Int, date: Int, can_reply: Bool, is_enabled: Bool, )
Arguments
- id
-
Unique identifier of the business connection
- user
-
Business account user that created the business connection
- user_chat_id
-
Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
- date
-
Date the connection was established in Unix time
- can_reply
-
True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours
- is_enabled
-
True, if the connection is active
Official reference: Contains information about the start page settings of a Telegram Business account.
pub type BusinessIntro {
BusinessIntro(
title: Option(String),
message: Option(String),
sticker: Option(Sticker),
)
}
Constructors
-
BusinessIntro( title: Option(String), message: Option(String), sticker: Option(Sticker), )
Arguments
- title
-
Optional. Title text of the business intro
- message
-
Optional. Message text of the business intro
- sticker
-
Optional. Sticker of the business intro
Official reference: Contains information about the location of a Telegram Business account.
pub type BusinessLocation {
BusinessLocation(address: String, location: Option(Location))
}
Constructors
-
BusinessLocation(address: String, location: Option(Location))
Arguments
- address
-
Address of the business
- location
-
Optional. Location of the business
Official reference: This object is received when messages are deleted from a connected business account.
pub type BusinessMessagesDeleted {
BusinessMessagesDeleted(
business_connection_id: String,
chat: Chat,
message_ids: List(Int),
)
}
Constructors
-
BusinessMessagesDeleted( business_connection_id: String, chat: Chat, message_ids: List(Int), )
Arguments
- business_connection_id
-
Unique identifier of the business connection
- chat
-
Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.
- message_ids
-
The list of identifiers of deleted messages in the chat of the business account
Official reference: Describes the opening hours of a business.
pub type BusinessOpeningHours {
BusinessOpeningHours(
time_zone_name: String,
opening_hours: List(BusinessOpeningHoursInterval),
)
}
Constructors
-
BusinessOpeningHours( time_zone_name: String, opening_hours: List(BusinessOpeningHoursInterval), )
Arguments
- time_zone_name
-
Unique name of the time zone for which the opening hours are defined
- opening_hours
-
List of time intervals describing business opening hours
Official reference: Describes an interval of time during which a business is open.
pub type BusinessOpeningHoursInterval {
BusinessOpeningHoursInterval(
opening_minute: Int,
closing_minute: Int,
)
}
Constructors
-
BusinessOpeningHoursInterval( opening_minute: Int, closing_minute: Int, )
Arguments
- opening_minute
-
The minute’s sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60
- closing_minute
-
The minute’s sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60
Official reference: A placeholder, currently holds no information. Use BotFather to set up your game.
pub type CallbackGame {
CallbackGame(
user_id: Int,
score: Int,
force: Option(Bool),
disable_edit_message: Option(Bool),
chat_id: Option(Int),
message_id: Option(Int),
inline_message_id: Option(String),
)
}
Constructors
-
CallbackGame( user_id: Int, score: Int, force: Option(Bool), disable_edit_message: Option(Bool), chat_id: Option(Int), message_id: Option(Int), inline_message_id: Option(String), )
Arguments
- user_id
-
User identifier
- score
-
New score, must be non-negative
- force
-
Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
- disable_edit_message
-
Pass True if the game message should not be automatically edited to include the current scoreboard
- chat_id
-
Required if inline_message_id is not specified. Unique identifier for the target chat
- message_id
-
Required if inline_message_id is not specified. Identifier of the sent message
- inline_message_id
-
Required if chat_id and message_id are not specified. Identifier of the inline message
Official reference: This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
pub type CallbackQuery {
CallbackQuery(
id: String,
from: User,
message: Option(MaybeInaccessibleMessage),
inline_message_id: Option(String),
chat_instance: String,
data: Option(String),
game_short_name: Option(String),
)
}
Constructors
-
CallbackQuery( id: String, from: User, message: Option(MaybeInaccessibleMessage), inline_message_id: Option(String), chat_instance: String, data: Option(String), game_short_name: Option(String), )
Arguments
- id
-
Unique identifier for this query
- from
-
Sender
- message
-
Optional. Message sent by the bot with the callback button that originated the query
- inline_message_id
-
Optional. Identifier of the message sent via the bot in inline mode, that originated the query.
- chat_instance
-
Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
- data
-
Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data.
- game_short_name
-
Optional. Short name of a Game to be returned, serves as the unique identifier for the game
Official reference: This object represents a chat.
pub type Chat {
Chat(
id: Int,
type_: Option(String),
title: Option(String),
username: Option(String),
first_name: Option(String),
last_name: Option(String),
is_forum: Option(Bool),
)
}
Constructors
-
Chat( id: Int, type_: Option(String), title: Option(String), username: Option(String), first_name: Option(String), last_name: Option(String), is_forum: Option(Bool), )
Arguments
- id
-
Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
- type_
-
Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
- title
-
Optional. Title, for supergroups, channels and group chats
- username
-
Optional. Username, for private chats, supergroups and channels if available
- first_name
-
Optional. First name of the other party in a private chat
- last_name
-
Optional. Last name of the other party in a private chat
- is_forum
-
Optional. True, if the supergroup chat is a forum (has topics enabled)
Official reference: Represents the rights of an administrator in a chat.
pub type ChatAdministratorRights {
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: Option(Bool),
can_edit_messages: Option(Bool),
can_pin_messages: Option(Bool),
can_manage_topics: Option(Bool),
)
}
Constructors
-
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: Option(Bool), can_edit_messages: Option(Bool), can_pin_messages: Option(Bool), can_manage_topics: Option(Bool), )
Arguments
- is_anonymous
-
True, if the user’s presence in the chat is hidden
- can_manage_chat
-
True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege.
- can_delete_messages
-
True, if the administrator can delete messages of other users
- can_manage_video_chats
-
True, if the administrator can manage video chats
- can_restrict_members
-
True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics
- can_promote_members
-
True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)
- can_change_info
-
True, if the user is allowed to change the chat title, photo and other settings
- can_invite_users
-
True, if the user is allowed to invite new users to the chat
- can_post_stories
-
True, if the administrator can post stories to the chat
- can_edit_stories
-
True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat’s story archive
- can_delete_stories
-
True, if the administrator can delete stories posted by other users
- can_post_messages
-
Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only
- can_edit_messages
-
Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only
- can_pin_messages
-
Optional. True, if the user is allowed to pin messages; for groups and supergroups only
- can_manage_topics
-
Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
Official reference: This object represents a chat background.
pub type ChatBackground {
ChatBackground(type_: BackgroundType)
}
Constructors
-
ChatBackground(type_: BackgroundType)
Arguments
- type_
-
Type of the background
Official reference: This object contains information about a chat boost.
pub type ChatBoost {
ChatBoost(
boost_id: String,
add_date: Int,
expiration_date: Int,
source: ChatBoostSource,
)
}
Constructors
-
ChatBoost( boost_id: String, add_date: Int, expiration_date: Int, source: ChatBoostSource, )
Arguments
- boost_id
-
Unique identifier of the boost
- add_date
-
Point in time (Unix timestamp) when the chat was boosted
- expiration_date
-
Point in time (Unix timestamp) when the boost will automatically expire, unless the booster’s Telegram Premium subscription is prolonged
- source
-
Source of the added boost
Official reference: This object represents a service message about a user boosting a chat.
pub type ChatBoostAdded {
ChatBoostAdded(boost_count: Int)
}
Constructors
-
ChatBoostAdded(boost_count: Int)
Arguments
- boost_count
-
Number of boosts added by the user
Official reference: This object represents a boost removed from a chat.
pub type ChatBoostRemoved {
ChatBoostRemoved(
chat: Chat,
boost_id: String,
remove_date: Int,
source: ChatBoostSource,
)
}
Constructors
-
ChatBoostRemoved( chat: Chat, boost_id: String, remove_date: Int, source: ChatBoostSource, )
Arguments
- chat
-
Chat which was boosted
- boost_id
-
Unique identifier of the boost
- remove_date
-
Point in time (Unix timestamp) when the boost was removed
- source
-
Source of the removed boost
pub type ChatBoostSource {
ChatBoostSourcePremiumChatBoostSource(ChatBoostSourcePremium)
ChatBoostSourceGiftCodeChatBoostSource(ChatBoostSourceGiftCode)
ChatBoostSourceGiveawayChatBoostSource(ChatBoostSourceGiveaway)
}
Constructors
-
ChatBoostSourcePremiumChatBoostSource(ChatBoostSourcePremium)
-
ChatBoostSourceGiftCodeChatBoostSource(ChatBoostSourceGiftCode)
-
ChatBoostSourceGiveawayChatBoostSource(ChatBoostSourceGiveaway)
Official reference: The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
pub type ChatBoostSourceGiftCode {
ChatBoostSourceGiftCode(source: String, user: User)
}
Constructors
-
ChatBoostSourceGiftCode(source: String, user: User)
Arguments
- source
-
Source of the boost, always “gift_code”
- user
-
User for which the gift code was created
Official reference: The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.
pub type ChatBoostSourceGiveaway {
ChatBoostSourceGiveaway(
source: String,
giveaway_message_id: Int,
user: Option(User),
prize_star_count: Option(Int),
is_unclaimed: Option(Bool),
)
}
Constructors
-
ChatBoostSourceGiveaway( source: String, giveaway_message_id: Int, user: Option(User), prize_star_count: Option(Int), is_unclaimed: Option(Bool), )
Arguments
- source
-
Source of the boost, always “giveaway”
- giveaway_message_id
-
Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn’t sent yet.
- user
-
Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only
- prize_star_count
-
Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
- is_unclaimed
-
Optional. True, if the giveaway was completed, but there was no user to win the prize
Official reference: The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
pub type ChatBoostSourcePremium {
ChatBoostSourcePremium(source: String, user: User)
}
Constructors
-
ChatBoostSourcePremium(source: String, user: User)
Arguments
- source
-
Source of the boost, always “premium”
- user
-
User that boosted the chat
Official reference: This object represents a boost added to a chat or changed.
pub type ChatBoostUpdated {
ChatBoostUpdated(chat: Chat, boost: ChatBoost)
}
Constructors
-
ChatBoostUpdated(chat: Chat, boost: ChatBoost)
Arguments
- chat
-
Chat which was boosted
- boost
-
Information about the chat boost
Official reference: This object contains full information about a chat.
pub type ChatFullInfo {
ChatFullInfo(
id: Int,
type_: String,
title: Option(String),
username: Option(String),
first_name: Option(String),
last_name: Option(String),
is_forum: Option(Bool),
accent_color_id: Int,
max_reaction_count: Int,
photo: Option(ChatPhoto),
active_usernames: Option(List(String)),
birthdate: Option(Birthdate),
business_intro: Option(BusinessIntro),
business_location: Option(BusinessLocation),
business_opening_hours: Option(BusinessOpeningHours),
personal_chat: Option(Chat),
available_reactions: Option(List(ReactionType)),
background_custom_emoji_id: Option(String),
profile_accent_color_id: Option(Int),
profile_background_custom_emoji_id: Option(String),
emoji_status_custom_emoji_id: Option(String),
emoji_status_expiration_date: Option(Int),
bio: Option(String),
has_private_forwards: Option(Bool),
has_restricted_voice_and_video_messages: Option(Bool),
join_to_send_messages: Option(Bool),
join_by_request: Option(Bool),
description: Option(String),
invite_link: Option(String),
pinned_message: Option(Message),
permissions: Option(ChatPermissions),
can_send_gift: Option(Bool),
can_send_paid_media: Option(Bool),
slow_mode_delay: Option(Int),
unrestrict_boost_count: Option(Int),
message_auto_delete_time: Option(Int),
has_aggressive_anti_spam_enabled: Option(Bool),
has_hidden_members: Option(Bool),
has_protected_content: Option(Bool),
has_visible_history: Option(Bool),
sticker_set_name: Option(String),
can_set_sticker_set: Option(Bool),
custom_emoji_sticker_set_name: Option(String),
linked_chat_id: Option(Int),
location: Option(ChatLocation),
)
}
Constructors
-
ChatFullInfo( id: Int, type_: String, title: Option(String), username: Option(String), first_name: Option(String), last_name: Option(String), is_forum: Option(Bool), accent_color_id: Int, max_reaction_count: Int, photo: Option(ChatPhoto), active_usernames: Option(List(String)), birthdate: Option(Birthdate), business_intro: Option(BusinessIntro), business_location: Option(BusinessLocation), business_opening_hours: Option(BusinessOpeningHours), personal_chat: Option(Chat), available_reactions: Option(List(ReactionType)), background_custom_emoji_id: Option(String), profile_accent_color_id: Option(Int), profile_background_custom_emoji_id: Option(String), emoji_status_custom_emoji_id: Option(String), emoji_status_expiration_date: Option(Int), bio: Option(String), has_private_forwards: Option(Bool), has_restricted_voice_and_video_messages: Option(Bool), join_to_send_messages: Option(Bool), join_by_request: Option(Bool), description: Option(String), invite_link: Option(String), pinned_message: Option(Message), permissions: Option(ChatPermissions), can_send_gift: Option(Bool), can_send_paid_media: Option(Bool), slow_mode_delay: Option(Int), unrestrict_boost_count: Option(Int), message_auto_delete_time: Option(Int), has_aggressive_anti_spam_enabled: Option(Bool), has_hidden_members: Option(Bool), has_protected_content: Option(Bool), has_visible_history: Option(Bool), sticker_set_name: Option(String), can_set_sticker_set: Option(Bool), custom_emoji_sticker_set_name: Option(String), linked_chat_id: Option(Int), location: Option(ChatLocation), )
Arguments
- id
-
Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
- type_
-
Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
- title
-
Optional. Title, for supergroups, channels and group chats
- username
-
Optional. Username, for private chats, supergroups and channels if available
- first_name
-
Optional. First name of the other party in a private chat
- last_name
-
Optional. Last name of the other party in a private chat
- is_forum
-
Optional. True, if the supergroup chat is a forum (has topics enabled)
- accent_color_id
-
Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.
- max_reaction_count
-
The maximum number of reactions that can be set on a message in the chat
- photo
-
Optional. Chat photo
- active_usernames
-
Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels
- birthdate
-
Optional. For private chats, the date of birth of the user
- business_intro
-
Optional. For private chats with business accounts, the intro of the business
- business_location
-
Optional. For private chats with business accounts, the location of the business
- business_opening_hours
-
Optional. For private chats with business accounts, the opening hours of the business
- personal_chat
-
Optional. For private chats, the personal channel of the user
- available_reactions
-
Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.
- background_custom_emoji_id
-
Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
- profile_accent_color_id
-
Optional. Identifier of the accent color for the chat’s profile background. See profile accent colors for more details.
- profile_background_custom_emoji_id
-
Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background
- emoji_status_custom_emoji_id
-
Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat
- emoji_status_expiration_date
-
Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any
- bio
-
Optional. Bio of the other party in a private chat
- has_private_forwards
-
Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user
- has_restricted_voice_and_video_messages
-
Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat
- join_to_send_messages
-
Optional. True, if users need to join the supergroup before they can send messages
- join_by_request
-
Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators
- description
-
Optional. Description, for groups, supergroups and channel chats
- invite_link
-
Optional. Primary invite link, for groups, supergroups and channel chats
- pinned_message
-
Optional. The most recent pinned message (by sending date)
- permissions
-
Optional. Default chat member permissions, for groups and supergroups
- can_send_gift
-
Optional. True, if gifts can be sent to the chat
- can_send_paid_media
-
Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.
- slow_mode_delay
-
Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds
- unrestrict_boost_count
-
Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions
- message_auto_delete_time
-
Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds
- has_aggressive_anti_spam_enabled
-
Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.
- has_hidden_members
-
Optional. True, if non-administrators can only get the list of bots and administrators in the chat
- has_protected_content
-
Optional. True, if messages from the chat can’t be forwarded to other chats
- has_visible_history
-
Optional. True, if new chat members will have access to old messages; available only to chat administrators
- sticker_set_name
-
Optional. For supergroups, name of the group sticker set
- can_set_sticker_set
-
Optional. True, if the bot can change the group sticker set
- custom_emoji_sticker_set_name
-
Optional. For supergroups, the name of the group’s custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.
- linked_chat_id
-
Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
- location
-
Optional. For supergroups, the location to which the supergroup is connected
Official reference: Represents an invite link for a chat.
pub type ChatInviteLink {
ChatInviteLink(
invite_link: String,
creator: User,
creates_join_request: Bool,
is_primary: Bool,
is_revoked: Bool,
name: Option(String),
expire_date: Option(Int),
member_limit: Option(Int),
pending_join_request_count: Option(Int),
subscription_period: Option(Int),
subscription_price: Option(Int),
)
}
Constructors
-
ChatInviteLink( invite_link: String, creator: User, creates_join_request: Bool, is_primary: Bool, is_revoked: Bool, name: Option(String), expire_date: Option(Int), member_limit: Option(Int), pending_join_request_count: Option(Int), subscription_period: Option(Int), subscription_price: Option(Int), )
Arguments
- invite_link
-
The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
- creator
-
Creator of the link
- creates_join_request
-
True, if users joining the chat via the link need to be approved by chat administrators
- is_primary
-
True, if the link is primary
- is_revoked
-
True, if the link is revoked
- name
-
Optional. Invite link name
- expire_date
-
Optional. Point in time (Unix timestamp) when the link will expire or has been expired
- member_limit
-
Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
- pending_join_request_count
-
Optional. Number of pending join requests created using this link
- subscription_period
-
Optional. The number of seconds the subscription will be active for before the next payment
- subscription_price
-
Optional. The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link
Official reference: Represents a join request sent to a chat.
pub type ChatJoinRequest {
ChatJoinRequest(
chat: Chat,
from: User,
user_chat_id: Int,
date: Int,
bio: Option(String),
invite_link: Option(ChatInviteLink),
)
}
Constructors
-
ChatJoinRequest( chat: Chat, from: User, user_chat_id: Int, date: Int, bio: Option(String), invite_link: Option(ChatInviteLink), )
Arguments
- chat
-
Chat to which the request was sent
- from
-
User that sent the join request
- user_chat_id
-
Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.
- date
-
Date the request was sent in Unix time
- bio
-
Optional. Bio of the user.
- invite_link
-
Optional. Chat invite link that was used by the user to send the join request
Official reference: Represents a location to which a chat is connected.
pub type ChatLocation {
ChatLocation(location: Location, address: String)
}
Constructors
-
ChatLocation(location: Location, address: String)
Arguments
- location
-
The location to which the supergroup is connected. Can’t be a live location.
- address
-
Location address; 1-64 characters, as defined by the chat owner
pub type ChatMember {
ChatMemberOwnerChatMember(ChatMemberOwner)
ChatMemberAdministratorChatMember(ChatMemberAdministrator)
ChatMemberMemberChatMember(ChatMemberMember)
ChatMemberRestrictedChatMember(ChatMemberRestricted)
ChatMemberLeftChatMember(ChatMemberLeft)
ChatMemberBannedChatMember(ChatMemberBanned)
}
Constructors
-
ChatMemberOwnerChatMember(ChatMemberOwner)
-
ChatMemberAdministratorChatMember(ChatMemberAdministrator)
-
ChatMemberMemberChatMember(ChatMemberMember)
-
ChatMemberRestrictedChatMember(ChatMemberRestricted)
-
ChatMemberLeftChatMember(ChatMemberLeft)
-
ChatMemberBannedChatMember(ChatMemberBanned)
Official reference: Represents a chat member that has some additional privileges.
pub type ChatMemberAdministrator {
ChatMemberAdministrator(
status: String,
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: Option(Bool),
can_edit_messages: Option(Bool),
can_pin_messages: Option(Bool),
can_manage_topics: Option(Bool),
custom_title: Option(String),
)
}
Constructors
-
ChatMemberAdministrator( status: String, 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: Option(Bool), can_edit_messages: Option(Bool), can_pin_messages: Option(Bool), can_manage_topics: Option(Bool), custom_title: Option(String), )
Arguments
- status
-
The member’s status in the chat, always “administrator”
- user
-
Information about the user
- can_be_edited
-
True, if the bot is allowed to edit administrator privileges of that user
- is_anonymous
-
True, if the user’s presence in the chat is hidden
- can_manage_chat
-
True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege.
- can_delete_messages
-
True, if the administrator can delete messages of other users
- can_manage_video_chats
-
True, if the administrator can manage video chats
- can_restrict_members
-
True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics
- can_promote_members
-
True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)
- can_change_info
-
True, if the user is allowed to change the chat title, photo and other settings
- can_invite_users
-
True, if the user is allowed to invite new users to the chat
- can_post_stories
-
True, if the administrator can post stories to the chat
- can_edit_stories
-
True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat’s story archive
- can_delete_stories
-
True, if the administrator can delete stories posted by other users
- can_post_messages
-
Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only
- can_edit_messages
-
Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only
- can_pin_messages
-
Optional. True, if the user is allowed to pin messages; for groups and supergroups only
- can_manage_topics
-
Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
- custom_title
-
Optional. Custom title for this user
Official reference: Represents a chat member that was banned in the chat and can’t return to the chat or view chat messages.
pub type ChatMemberBanned {
ChatMemberBanned(status: String, user: User, until_date: Int)
}
Constructors
-
ChatMemberBanned(status: String, user: User, until_date: Int)
Arguments
- status
-
The member’s status in the chat, always “kicked”
- user
-
Information about the user
- until_date
-
Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever
Official reference: Represents a chat member that isn’t currently a member of the chat, but may join it themselves.
pub type ChatMemberLeft {
ChatMemberLeft(status: String, user: User)
}
Constructors
-
ChatMemberLeft(status: String, user: User)
Arguments
- status
-
The member’s status in the chat, always “left”
- user
-
Information about the user
Official reference: Represents a chat member that has no additional privileges or restrictions.
pub type ChatMemberMember {
ChatMemberMember(
status: String,
user: User,
until_date: Option(Int),
)
}
Constructors
-
ChatMemberMember( status: String, user: User, until_date: Option(Int), )
Arguments
- status
-
The member’s status in the chat, always “member”
- user
-
Information about the user
- until_date
-
Optional. Date when the user’s subscription will expire; Unix time
Official reference: Represents a chat member that owns the chat and has all administrator privileges.
pub type ChatMemberOwner {
ChatMemberOwner(
status: String,
user: User,
is_anonymous: Bool,
custom_title: Option(String),
)
}
Constructors
-
ChatMemberOwner( status: String, user: User, is_anonymous: Bool, custom_title: Option(String), )
Arguments
- status
-
The member’s status in the chat, always “creator”
- user
-
Information about the user
- is_anonymous
-
True, if the user’s presence in the chat is hidden
- custom_title
-
Optional. Custom title for this user
Official reference: Represents a chat member that is under certain restrictions in the chat. Supergroups only.
pub type ChatMemberRestricted {
ChatMemberRestricted(
status: String,
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,
)
}
Constructors
-
ChatMemberRestricted( status: String, 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, )
Arguments
- status
-
The member’s status in the chat, always “restricted”
- user
-
Information about the user
- is_member
-
True, if the user is a member of the chat at the moment of the request
- can_send_messages
-
True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues
- can_send_audios
-
True, if the user is allowed to send audios
- can_send_documents
-
True, if the user is allowed to send documents
- can_send_photos
-
True, if the user is allowed to send photos
- can_send_videos
-
True, if the user is allowed to send videos
- can_send_video_notes
-
True, if the user is allowed to send video notes
- can_send_voice_notes
-
True, if the user is allowed to send voice notes
- can_send_polls
-
True, if the user is allowed to send polls
- can_send_other_messages
-
True, if the user is allowed to send animations, games, stickers and use inline bots
- can_add_web_page_previews
-
True, if the user is allowed to add web page previews to their messages
- can_change_info
-
True, if the user is allowed to change the chat title, photo and other settings
- can_invite_users
-
True, if the user is allowed to invite new users to the chat
- can_pin_messages
-
True, if the user is allowed to pin messages
- can_manage_topics
-
True, if the user is allowed to create forum topics
- until_date
-
Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever
Official reference: This object represents changes in the status of a chat member.
pub type ChatMemberUpdated {
ChatMemberUpdated(
chat: Chat,
from: User,
date: Int,
old_chat_member: ChatMember,
new_chat_member: ChatMember,
invite_link: Option(ChatInviteLink),
via_join_request: Option(Bool),
via_chat_folder_invite_link: Option(Bool),
)
}
Constructors
-
ChatMemberUpdated( chat: Chat, from: User, date: Int, old_chat_member: ChatMember, new_chat_member: ChatMember, invite_link: Option(ChatInviteLink), via_join_request: Option(Bool), via_chat_folder_invite_link: Option(Bool), )
Arguments
- chat
-
Chat the user belongs to
- from
-
Performer of the action, which resulted in the change
- date
-
Date the change was done in Unix time
- old_chat_member
-
Previous information about the chat member
- new_chat_member
-
New information about the chat member
- invite_link
-
Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
- via_join_request
-
Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator
- via_chat_folder_invite_link
-
Optional. True, if the user joined the chat via a chat folder invite link
Official reference: Describes actions that a non-administrator user is allowed to take in a chat.
pub type ChatPermissions {
ChatPermissions(
can_send_messages: Option(Bool),
can_send_audios: Option(Bool),
can_send_documents: Option(Bool),
can_send_photos: Option(Bool),
can_send_videos: Option(Bool),
can_send_video_notes: Option(Bool),
can_send_voice_notes: Option(Bool),
can_send_polls: Option(Bool),
can_send_other_messages: Option(Bool),
can_add_web_page_previews: Option(Bool),
can_change_info: Option(Bool),
can_invite_users: Option(Bool),
can_pin_messages: Option(Bool),
can_manage_topics: Option(Bool),
)
}
Constructors
-
ChatPermissions( can_send_messages: Option(Bool), can_send_audios: Option(Bool), can_send_documents: Option(Bool), can_send_photos: Option(Bool), can_send_videos: Option(Bool), can_send_video_notes: Option(Bool), can_send_voice_notes: Option(Bool), can_send_polls: Option(Bool), can_send_other_messages: Option(Bool), can_add_web_page_previews: Option(Bool), can_change_info: Option(Bool), can_invite_users: Option(Bool), can_pin_messages: Option(Bool), can_manage_topics: Option(Bool), )
Arguments
- can_send_messages
-
Optional. True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues
- can_send_audios
-
Optional. True, if the user is allowed to send audios
- can_send_documents
-
Optional. True, if the user is allowed to send documents
- can_send_photos
-
Optional. True, if the user is allowed to send photos
- can_send_videos
-
Optional. True, if the user is allowed to send videos
- can_send_video_notes
-
Optional. True, if the user is allowed to send video notes
- can_send_voice_notes
-
Optional. True, if the user is allowed to send voice notes
- can_send_polls
-
Optional. True, if the user is allowed to send polls
- can_send_other_messages
-
Optional. True, if the user is allowed to send animations, games, stickers and use inline bots
- can_add_web_page_previews
-
Optional. True, if the user is allowed to add web page previews to their messages
- can_change_info
-
Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
- can_invite_users
-
Optional. True, if the user is allowed to invite new users to the chat
- can_pin_messages
-
Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
- can_manage_topics
-
Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
Official reference: This object represents a chat photo.
pub type ChatPhoto {
ChatPhoto(
small_file_id: String,
small_file_unique_id: String,
big_file_id: String,
big_file_unique_id: String,
)
}
Constructors
-
ChatPhoto( small_file_id: String, small_file_unique_id: String, big_file_id: String, big_file_unique_id: String, )
Arguments
- small_file_id
-
File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
- small_file_unique_id
-
Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- big_file_id
-
File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
- big_file_unique_id
-
Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
Official reference: This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
pub type ChatShared {
ChatShared(
request_id: Int,
chat_id: Int,
title: Option(String),
username: Option(String),
photo: Option(List(PhotoSize)),
)
}
Constructors
-
ChatShared( request_id: Int, chat_id: Int, title: Option(String), username: Option(String), photo: Option(List(PhotoSize)), )
Arguments
- request_id
-
Identifier of the request
- chat_id
-
Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
- title
-
Optional. Title of the chat, if the title was requested by the bot.
- username
-
Optional. Username of the chat, if the username was requested by the bot and available.
- photo
-
Optional. Available sizes of the chat photo, if the photo was requested by the bot
Official reference: Represents a result of an inline query that was chosen by the user and sent to their chat partner.
pub type ChosenInlineResult {
ChosenInlineResult(
result_id: String,
from: User,
location: Option(Location),
inline_message_id: Option(String),
query: String,
)
}
Constructors
-
ChosenInlineResult( result_id: String, from: User, location: Option(Location), inline_message_id: Option(String), query: String, )
Arguments
- result_id
-
The unique identifier for the result that was chosen
- from
-
The user that chose the result
- location
-
Optional. Sender location, only for bots that require user location
- inline_message_id
-
Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.
- query
-
The query that was used to obtain the result
Official reference: This object represents a phone contact.
pub type Contact {
Contact(
phone_number: String,
first_name: String,
last_name: Option(String),
user_id: Option(Int),
vcard: Option(String),
)
}
Constructors
-
Contact( phone_number: String, first_name: String, last_name: Option(String), user_id: Option(Int), vcard: Option(String), )
Arguments
- phone_number
-
Contact’s phone number
- first_name
-
Contact’s first name
- last_name
-
Optional. Contact’s last name
- user_id
-
Optional. Contact’s user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
- vcard
-
Optional. Additional data about the contact in the form of a vCard
Official reference: This object represents an inline keyboard button that copies specified text to the clipboard.
pub type CopyTextButton {
CopyTextButton(text: String)
}
Constructors
-
CopyTextButton(text: String)
Arguments
- text
-
The text to be copied to the clipboard; 1-256 characters
Official reference: This object represents an animated emoji that displays a random value.
pub type Dice {
Dice(emoji: String, value: Int)
}
Constructors
-
Dice(emoji: String, value: Int)
Arguments
- emoji
-
Emoji on which the dice throw animation is based
- value
-
Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji
Official reference: This object represents a general file (as opposed to photos, voice messages and audio files).
pub type Document {
Document(
file_id: String,
file_unique_id: String,
thumbnail: Option(PhotoSize),
file_name: Option(String),
mime_type: Option(String),
file_size: Option(Int),
)
}
Constructors
-
Document( file_id: String, file_unique_id: String, thumbnail: Option(PhotoSize), file_name: Option(String), mime_type: Option(String), file_size: Option(Int), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- thumbnail
-
Optional. Document thumbnail as defined by the sender
- file_name
-
Optional. Original filename as defined by the sender
- mime_type
-
Optional. MIME type of the file as defined by the sender
- file_size
-
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
pub type EditMessageTextParameters {
EditMessageTextParameters(
chat_id: Option(IntOrString),
message_id: Option(Int),
inline_message_id: Option(String),
text: String,
parse_mode: Option(String),
entities: Option(List(MessageEntity)),
link_preview_options: Option(LinkPreviewOptions),
reply_markup: Option(InlineKeyboardMarkup),
)
}
Constructors
-
EditMessageTextParameters( chat_id: Option(IntOrString), message_id: Option(Int), inline_message_id: Option(String), text: String, parse_mode: Option(String), entities: Option(List(MessageEntity)), link_preview_options: Option(LinkPreviewOptions), reply_markup: Option(InlineKeyboardMarkup), )
Arguments
- chat_id
-
Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format
@channelusername
) - message_id
-
Required if inline_message_id is not specified. Identifier of the message to edit
- inline_message_id
-
Required if chat_id and message_id are not specified. Identifier of the inline message
- text
-
New text of the message, 1-4096 characters after entities parsing
- parse_mode
-
Mode for parsing entities in the message text. See formatting options for more details.
- entities
-
A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
- link_preview_options
-
Link preview generation options for the message
- reply_markup
-
A JSON-serialized object for an inline keyboard.
Official reference: Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
pub type EncryptedCredentials {
EncryptedCredentials(
data: String,
hash: String,
secret: String,
)
}
Constructors
-
EncryptedCredentials(data: String, hash: String, secret: String)
Arguments
- data
-
Base64-encoded encrypted JSON-serialized data with unique user’s payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
- hash
-
Base64-encoded data hash for data authentication
- secret
-
Base64-encoded secret, encrypted with the bot’s public RSA key, required for data decryption
Official reference: Describes documents or other Telegram Passport elements shared with the bot by the user.
pub type EncryptedPassportElement {
EncryptedPassportElement(
type_: String,
data: Option(String),
phone_number: Option(String),
email: Option(String),
files: Option(List(PassportFile)),
front_side: Option(PassportFile),
reverse_side: Option(PassportFile),
selfie: Option(PassportFile),
translation: Option(List(PassportFile)),
hash: String,
)
}
Constructors
-
EncryptedPassportElement( type_: String, data: Option(String), phone_number: Option(String), email: Option(String), files: Option(List(PassportFile)), front_side: Option(PassportFile), reverse_side: Option(PassportFile), selfie: Option(PassportFile), translation: Option(List(PassportFile)), hash: String, )
Arguments
- type_
-
Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
- data
-
Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
- phone_number
-
Optional. User’s verified phone number; available only for “phone_number” type
-
Optional. User’s verified email address; available only for “email” type
- files
-
Optional. Array of encrypted files with documents provided by the user; available only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
- front_side
-
Optional. Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
- reverse_side
-
Optional. Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
- selfie
-
Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
- translation
-
Optional. Array of encrypted files with translated versions of documents provided by the user; available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
- hash
-
Base64-encoded element hash for using in PassportElementErrorUnspecified
Official reference: This object contains information about a message that is being replied to, which may come from another chat or forum topic.
pub type ExternalReplyInfo {
ExternalReplyInfo(
origin: MessageOrigin,
chat: Option(Chat),
message_id: Option(Int),
link_preview_options: Option(LinkPreviewOptions),
animation: Option(Animation),
audio: Option(Audio),
document: Option(Document),
paid_media: Option(PaidMediaInfo),
photo: Option(List(PhotoSize)),
sticker: Option(Sticker),
story: Option(Story),
video: Option(Video),
video_note: Option(VideoNote),
voice: Option(Voice),
has_media_spoiler: Option(Bool),
contact: Option(Contact),
dice: Option(Dice),
game: Option(Game),
giveaway: Option(Giveaway),
giveaway_winners: Option(GiveawayWinners),
invoice: Option(Invoice),
location: Option(Location),
poll: Option(Poll),
venue: Option(Venue),
)
}
Constructors
-
ExternalReplyInfo( origin: MessageOrigin, chat: Option(Chat), message_id: Option(Int), link_preview_options: Option(LinkPreviewOptions), animation: Option(Animation), audio: Option(Audio), document: Option(Document), paid_media: Option(PaidMediaInfo), photo: Option(List(PhotoSize)), sticker: Option(Sticker), story: Option(Story), video: Option(Video), video_note: Option(VideoNote), voice: Option(Voice), has_media_spoiler: Option(Bool), contact: Option(Contact), dice: Option(Dice), game: Option(Game), giveaway: Option(Giveaway), giveaway_winners: Option(GiveawayWinners), invoice: Option(Invoice), location: Option(Location), poll: Option(Poll), venue: Option(Venue), )
Arguments
- origin
-
Origin of the message replied to by the given message
- chat
-
Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
- message_id
-
Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
- link_preview_options
-
Optional. Options used for link preview generation for the original message, if it is a text message
- animation
-
Optional. Message is an animation, information about the animation
- audio
-
Optional. Message is an audio file, information about the file
- document
-
Optional. Message is a general file, information about the file
- paid_media
-
Optional. Message contains paid media; information about the paid media
- photo
-
Optional. Message is a photo, available sizes of the photo
- sticker
-
Optional. Message is a sticker, information about the sticker
- story
-
Optional. Message is a forwarded story
- video
-
Optional. Message is a video, information about the video
- video_note
-
Optional. Message is a video note, information about the video message
- voice
-
Optional. Message is a voice message, information about the file
- has_media_spoiler
-
Optional. True, if the message media is covered by a spoiler animation
- contact
-
Optional. Message is a shared contact, information about the contact
- dice
-
Optional. Message is a dice with random value
- game
-
Optional. Message is a game, information about the game. More about games »
- giveaway
-
Optional. Message is a scheduled giveaway, information about the giveaway
- giveaway_winners
-
Optional. A giveaway with public winners was completed
- invoice
-
Optional. Message is an invoice for a payment, information about the invoice. More about payments »
- location
-
Optional. Message is a shared location, information about the location
- poll
-
Optional. Message is a native poll, information about the poll
- venue
-
Optional. Message is a venue, information about the venue
Official reference: This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot
pub type File {
File(
file_id: String,
file_unique_id: String,
file_size: Option(Int),
file_path: Option(String),
)
}
Constructors
-
File( file_id: String, file_unique_id: String, file_size: Option(Int), file_path: Option(String), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- file_size
-
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
- file_path
-
Optional. File path. Use https://api.telegram.org/file/bot
/<file_path> to get the file.
pub type FileOrString {
FileV(value: File)
StringV(string: String)
}
Constructors
-
FileV(value: File)
-
StringV(string: String)
Official reference: 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’). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.
pub type ForceReply {
ForceReply(
force_reply: Bool,
input_field_placeholder: Option(String),
selective: Option(Bool),
)
}
Constructors
-
ForceReply( force_reply: Bool, input_field_placeholder: Option(String), selective: Option(Bool), )
Arguments
- force_reply
-
Shows reply interface to the user, as if they manually selected the bot’s message and tapped ‘Reply’
- input_field_placeholder
-
Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
- selective
-
Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message.
Official reference: This object represents a forum topic.
pub type ForumTopic {
ForumTopic(
message_thread_id: Int,
name: String,
icon_color: Int,
icon_custom_emoji_id: Option(String),
)
}
Constructors
-
ForumTopic( message_thread_id: Int, name: String, icon_color: Int, icon_custom_emoji_id: Option(String), )
Arguments
- message_thread_id
-
Unique identifier of the forum topic
- name
-
Name of the topic
- icon_color
-
Color of the topic icon in RGB format
- icon_custom_emoji_id
-
Optional. Unique identifier of the custom emoji shown as the topic icon
pub type ForumTopicClosed {
ForumTopicClosed
}
Constructors
-
ForumTopicClosed
Official reference: This object represents a service message about a new forum topic created in the chat.
pub type ForumTopicCreated {
ForumTopicCreated(
name: String,
icon_color: Int,
icon_custom_emoji_id: Option(String),
)
}
Constructors
-
ForumTopicCreated( name: String, icon_color: Int, icon_custom_emoji_id: Option(String), )
Arguments
- name
-
Name of the topic
- icon_color
-
Color of the topic icon in RGB format
- icon_custom_emoji_id
-
Optional. Unique identifier of the custom emoji shown as the topic icon
Official reference: This object represents a service message about an edited forum topic.
pub type ForumTopicEdited {
ForumTopicEdited(
name: Option(String),
icon_custom_emoji_id: Option(String),
)
}
Constructors
-
ForumTopicEdited( name: Option(String), icon_custom_emoji_id: Option(String), )
Arguments
- name
-
Optional. New name of the topic, if it was edited
- icon_custom_emoji_id
-
Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed
pub type ForumTopicReopened {
ForumTopicReopened
}
Constructors
-
ForumTopicReopened
pub type ForwardMessageParameters {
ForwardMessageParameters(
chat_id: IntOrString,
from_chat_id: IntOrString,
message_id: Int,
disable_notification: Option(Bool),
message_thread_id: Option(Int),
protect_content: Option(Bool),
)
}
Constructors
-
ForwardMessageParameters( chat_id: IntOrString, from_chat_id: IntOrString, message_id: Int, disable_notification: Option(Bool), message_thread_id: Option(Int), protect_content: Option(Bool), )
Arguments
- chat_id
-
Unique identifier for the target chat or username of the target channel (in the format
@channelusername
) - from_chat_id
-
Unique identifier for the chat where the original message was sent (or channel username in the format
@channelusername
) - message_id
-
Message identifier in the chat specified in from_chat_id
- disable_notification
-
Sends the message silently. Users will receive a notification with no sound.
- message_thread_id
-
Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
- protect_content
-
Protects the contents of the forwarded message from forwarding and saving
Official reference: This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
pub type Game {
Game(
title: String,
description: String,
photo: List(PhotoSize),
text: Option(String),
text_entities: Option(List(MessageEntity)),
animation: Option(Animation),
)
}
Constructors
-
Game( title: String, description: String, photo: List(PhotoSize), text: Option(String), text_entities: Option(List(MessageEntity)), animation: Option(Animation), )
Arguments
- title
-
Title of the game
- description
-
Description of the game
- photo
-
Photo that will be displayed in the game message in chats.
- text
-
Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
- text_entities
-
Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
- animation
-
Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
Official reference: This object represents one row of the high scores table for a game.
pub type GameHighScore {
GameHighScore(position: Int, user: User, score: Int)
}
Constructors
-
GameHighScore(position: Int, user: User, score: Int)
Arguments
- position
-
Position in high score table for the game
- user
-
User
- score
-
Score
pub type GeneralForumTopicHidden {
GeneralForumTopicHidden
}
Constructors
-
GeneralForumTopicHidden
pub type GeneralForumTopicUnhidden {
GeneralForumTopicUnhidden
}
Constructors
-
GeneralForumTopicUnhidden
Official reference: This object represents a gift that can be sent by the bot.
pub type Gift {
Gift(
id: String,
sticker: Sticker,
star_count: Int,
upgrade_star_count: Option(Int),
total_count: Option(Int),
remaining_count: Option(Int),
)
}
Constructors
-
Gift( id: String, sticker: Sticker, star_count: Int, upgrade_star_count: Option(Int), total_count: Option(Int), remaining_count: Option(Int), )
Arguments
- id
-
Unique identifier of the gift
- sticker
-
The sticker that represents the gift
- star_count
-
The number of Telegram Stars that must be paid to send the sticker
- upgrade_star_count
-
Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one
- total_count
-
Optional. The total number of the gifts of this type that can be sent; for limited gifts only
- remaining_count
-
Optional. The number of remaining gifts of this type that can be sent; for limited gifts only
Official reference: This object represent a list of gifts.
pub type Gifts {
Gifts(gifts: List(Gift))
}
Constructors
-
Gifts(gifts: List(Gift))
Arguments
- gifts
-
The list of gifts
Official reference: This object represents a message about a scheduled giveaway.
pub type Giveaway {
Giveaway(
chats: List(Chat),
winners_selection_date: Int,
winner_count: Int,
only_new_members: Option(Bool),
has_public_winners: Option(Bool),
prize_description: Option(String),
country_codes: Option(List(String)),
prize_star_count: Option(Int),
premium_subscription_month_count: Option(Int),
)
}
Constructors
-
Giveaway( chats: List(Chat), winners_selection_date: Int, winner_count: Int, only_new_members: Option(Bool), has_public_winners: Option(Bool), prize_description: Option(String), country_codes: Option(List(String)), prize_star_count: Option(Int), premium_subscription_month_count: Option(Int), )
Arguments
- chats
-
The list of chats which the user must join to participate in the giveaway
- winners_selection_date
-
Point in time (Unix timestamp) when winners of the giveaway will be selected
- winner_count
-
The number of users which are supposed to be selected as winners of the giveaway
- only_new_members
-
Optional. True, if only users who join the chats after the giveaway started should be eligible to win
- has_public_winners
-
Optional. True, if the list of giveaway winners will be visible to everyone
- prize_description
-
Optional. Description of additional giveaway prize
- country_codes
-
Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.
- prize_star_count
-
Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
- premium_subscription_month_count
-
Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
Official reference: This object represents a service message about the completion of a giveaway without public winners.
pub type GiveawayCompleted {
GiveawayCompleted(
winner_count: Int,
unclaimed_prize_count: Option(Int),
giveaway_message: Option(Message),
is_star_giveaway: Option(Bool),
)
}
Constructors
-
GiveawayCompleted( winner_count: Int, unclaimed_prize_count: Option(Int), giveaway_message: Option(Message), is_star_giveaway: Option(Bool), )
Arguments
- winner_count
-
Number of winners in the giveaway
- unclaimed_prize_count
-
Optional. Number of undistributed prizes
- giveaway_message
-
Optional. Message with the giveaway that was completed, if it wasn’t deleted
- is_star_giveaway
-
Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.
Official reference: This object represents a service message about the creation of a scheduled giveaway.
pub type GiveawayCreated {
GiveawayCreated(prize_star_count: Option(Int))
}
Constructors
-
GiveawayCreated(prize_star_count: Option(Int))
Arguments
- prize_star_count
-
Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
Official reference: This object represents a message about the completion of a giveaway with public winners.
pub type GiveawayWinners {
GiveawayWinners(
chat: Chat,
giveaway_message_id: Int,
winners_selection_date: Int,
winner_count: Int,
winners: List(User),
additional_chat_count: Option(Int),
prize_star_count: Option(Int),
premium_subscription_month_count: Option(Int),
unclaimed_prize_count: Option(Int),
only_new_members: Option(Bool),
was_refunded: Option(Bool),
prize_description: Option(String),
)
}
Constructors
-
GiveawayWinners( chat: Chat, giveaway_message_id: Int, winners_selection_date: Int, winner_count: Int, winners: List(User), additional_chat_count: Option(Int), prize_star_count: Option(Int), premium_subscription_month_count: Option(Int), unclaimed_prize_count: Option(Int), only_new_members: Option(Bool), was_refunded: Option(Bool), prize_description: Option(String), )
Arguments
- chat
-
The chat that created the giveaway
- giveaway_message_id
-
Identifier of the message with the giveaway in the chat
- winners_selection_date
-
Point in time (Unix timestamp) when winners of the giveaway were selected
- winner_count
-
Total number of winners in the giveaway
- winners
-
List of up to 100 winners of the giveaway
- additional_chat_count
-
Optional. The number of other chats the user had to join in order to be eligible for the giveaway
- prize_star_count
-
Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
- premium_subscription_month_count
-
Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
- unclaimed_prize_count
-
Optional. Number of undistributed prizes
- only_new_members
-
Optional. True, if only users who had joined the chats after the giveaway started were eligible to win
- was_refunded
-
Optional. True, if the giveaway was canceled because the payment for it was refunded
- prize_description
-
Optional. Description of additional giveaway prize
Official reference: This object describes a message that was deleted or is otherwise inaccessible to the bot.
pub type InaccessibleMessage {
InaccessibleMessage(chat: Chat, message_id: Int, date: Int)
}
Constructors
-
InaccessibleMessage(chat: Chat, message_id: Int, date: Int)
Arguments
- chat
-
Chat the message belonged to
- message_id
-
Unique message identifier inside the chat
- date
-
Always 0. The field can be used to differentiate regular and inaccessible messages.
Official reference: This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.
pub type InlineKeyboardButton {
InlineKeyboardButton(
text: String,
url: Option(String),
callback_data: Option(String),
web_app: Option(WebAppInfo),
login_url: Option(LoginUrl),
switch_inline_query: Option(String),
switch_inline_query_current_chat: Option(String),
switch_inline_query_chosen_chat: Option(
SwitchInlineQueryChosenChat,
),
copy_text: Option(CopyTextButton),
callback_game: Option(CallbackGame),
pay: Option(Bool),
)
}
Constructors
-
InlineKeyboardButton( text: String, url: Option(String), callback_data: Option(String), web_app: Option(WebAppInfo), login_url: Option(LoginUrl), switch_inline_query: Option(String), switch_inline_query_current_chat: Option(String), switch_inline_query_chosen_chat: Option( SwitchInlineQueryChosenChat, ), copy_text: Option(CopyTextButton), callback_game: Option(CallbackGame), pay: Option(Bool), )
Arguments
- text
-
Label text on the button
- url
-
Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
- callback_data
-
Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes
- web_app
-
Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.
- login_url
-
Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
- switch_inline_query
-
Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field. May be empty, in which case just the bot’s username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.
- switch_inline_query_current_chat
-
Optional. If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field. May be empty, in which case only the bot’s username will be inserted.
This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.
- switch_inline_query_chosen_chat
-
Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot’s username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account.
- copy_text
-
Optional. Description of the button that copies the specified text to the clipboard.
- callback_game
-
Optional. Description of the game that will be launched when the user presses the button.
NOTE: This type of button must always be the first button in the first row.
- pay
-
Optional. Specify True, to send a Pay button. Substrings “” and “XTR” in the buttons’s text will be replaced with a Telegram Star icon.
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
Official reference: This object represents an inline keyboard that appears right next to the message it belongs to.
pub type InlineKeyboardMarkup {
InlineKeyboardMarkup(
inline_keyboard: List(List(InlineKeyboardButton)),
)
}
Constructors
-
InlineKeyboardMarkup( inline_keyboard: List(List(InlineKeyboardButton)), )
Arguments
- inline_keyboard
-
Array of button rows, each represented by an Array of InlineKeyboardButton objects
Official reference: This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
pub type InlineQuery {
InlineQuery(
id: String,
from: User,
query: String,
offset: String,
chat_type: Option(String),
location: Option(Location),
)
}
Constructors
-
InlineQuery( id: String, from: User, query: String, offset: String, chat_type: Option(String), location: Option(Location), )
Arguments
- id
-
Unique identifier for this query
- from
-
Sender
- query
-
Text of the query (up to 256 characters)
- offset
-
Offset of the results to be returned, can be controlled by the bot
- chat_type
-
Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
- location
-
Optional. Sender location, only for bots that request user location
pub type InlineQueryResult {
InlineQueryResultCachedAudioInlineQueryResult(
InlineQueryResultCachedAudio,
)
InlineQueryResultCachedDocumentInlineQueryResult(
InlineQueryResultCachedDocument,
)
InlineQueryResultCachedGifInlineQueryResult(
InlineQueryResultCachedGif,
)
InlineQueryResultCachedMpeg4GifInlineQueryResult(
InlineQueryResultCachedMpeg4Gif,
)
InlineQueryResultCachedPhotoInlineQueryResult(
InlineQueryResultCachedPhoto,
)
InlineQueryResultCachedStickerInlineQueryResult(
InlineQueryResultCachedSticker,
)
InlineQueryResultCachedVideoInlineQueryResult(
InlineQueryResultCachedVideo,
)
InlineQueryResultCachedVoiceInlineQueryResult(
InlineQueryResultCachedVoice,
)
InlineQueryResultArticleInlineQueryResult(
InlineQueryResultArticle,
)
InlineQueryResultAudioInlineQueryResult(InlineQueryResultAudio)
InlineQueryResultContactInlineQueryResult(
InlineQueryResultContact,
)
InlineQueryResultGameInlineQueryResult(InlineQueryResultGame)
InlineQueryResultDocumentInlineQueryResult(
InlineQueryResultDocument,
)
InlineQueryResultGifInlineQueryResult(InlineQueryResultGif)
InlineQueryResultLocationInlineQueryResult(
InlineQueryResultLocation,
)
InlineQueryResultMpeg4GifInlineQueryResult(
InlineQueryResultMpeg4Gif,
)
InlineQueryResultPhotoInlineQueryResult(InlineQueryResultPhoto)
InlineQueryResultVenueInlineQueryResult(InlineQueryResultVenue)
InlineQueryResultVideoInlineQueryResult(InlineQueryResultVideo)
InlineQueryResultVoiceInlineQueryResult(InlineQueryResultVoice)
}
Constructors
-
InlineQueryResultCachedAudioInlineQueryResult( InlineQueryResultCachedAudio, )
-
InlineQueryResultCachedDocumentInlineQueryResult( InlineQueryResultCachedDocument, )
-
InlineQueryResultCachedGifInlineQueryResult( InlineQueryResultCachedGif, )
-
InlineQueryResultCachedMpeg4GifInlineQueryResult( InlineQueryResultCachedMpeg4Gif, )
-
InlineQueryResultCachedPhotoInlineQueryResult( InlineQueryResultCachedPhoto, )
-
InlineQueryResultCachedStickerInlineQueryResult( InlineQueryResultCachedSticker, )
-
InlineQueryResultCachedVideoInlineQueryResult( InlineQueryResultCachedVideo, )
-
InlineQueryResultCachedVoiceInlineQueryResult( InlineQueryResultCachedVoice, )
-
InlineQueryResultArticleInlineQueryResult( InlineQueryResultArticle, )
-
InlineQueryResultAudioInlineQueryResult(InlineQueryResultAudio)
-
InlineQueryResultContactInlineQueryResult( InlineQueryResultContact, )
-
InlineQueryResultGameInlineQueryResult(InlineQueryResultGame)
-
InlineQueryResultDocumentInlineQueryResult( InlineQueryResultDocument, )
-
InlineQueryResultGifInlineQueryResult(InlineQueryResultGif)
-
InlineQueryResultLocationInlineQueryResult( InlineQueryResultLocation, )
-
InlineQueryResultMpeg4GifInlineQueryResult( InlineQueryResultMpeg4Gif, )
-
InlineQueryResultPhotoInlineQueryResult(InlineQueryResultPhoto)
-
InlineQueryResultVenueInlineQueryResult(InlineQueryResultVenue)
-
InlineQueryResultVideoInlineQueryResult(InlineQueryResultVideo)
-
InlineQueryResultVoiceInlineQueryResult(InlineQueryResultVoice)
Official reference: Represents a link to an article or web page.
pub type InlineQueryResultArticle {
InlineQueryResultArticle(
type_: String,
id: String,
title: String,
input_message_content: InputMessageContent,
reply_markup: Option(InlineKeyboardMarkup),
url: Option(String),
description: Option(String),
thumbnail_url: Option(String),
thumbnail_width: Option(Int),
thumbnail_height: Option(Int),
)
}
Constructors
-
InlineQueryResultArticle( type_: String, id: String, title: String, input_message_content: InputMessageContent, reply_markup: Option(InlineKeyboardMarkup), url: Option(String), description: Option(String), thumbnail_url: Option(String), thumbnail_width: Option(Int), thumbnail_height: Option(Int), )
Arguments
- type_
-
Type of the result, must be article
- id
-
Unique identifier for this result, 1-64 Bytes
- title
-
Title of the result
- input_message_content
-
Content of the message to be sent
- reply_markup
-
Optional. Inline keyboard attached to the message
- url
-
Optional. URL of the result
- description
-
Optional. Short description of the result
- thumbnail_url
-
Optional. Url of the thumbnail for the result
- thumbnail_width
-
Optional. Thumbnail width
- thumbnail_height
-
Optional. Thumbnail height
Official reference: 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.
pub type InlineQueryResultAudio {
InlineQueryResultAudio(
type_: String,
id: String,
audio_url: String,
title: String,
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
performer: Option(String),
audio_duration: Option(Int),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultAudio( type_: String, id: String, audio_url: String, title: String, caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), performer: Option(String), audio_duration: Option(Int), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be audio
- id
-
Unique identifier for this result, 1-64 bytes
- audio_url
-
A valid URL for the audio file
- title
-
Title
- caption
-
Optional. Caption, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- performer
-
Optional. Performer
- audio_duration
-
Optional. Audio duration in seconds
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the audio
Official reference: 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.
pub type InlineQueryResultCachedAudio {
InlineQueryResultCachedAudio(
type_: String,
id: String,
audio_file_id: String,
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedAudio( type_: String, id: String, audio_file_id: String, caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be audio
- id
-
Unique identifier for this result, 1-64 bytes
- audio_file_id
-
A valid file identifier for the audio file
- caption
-
Optional. Caption, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the audio
Official reference: 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.
pub type InlineQueryResultCachedDocument {
InlineQueryResultCachedDocument(
type_: String,
id: String,
title: String,
document_file_id: String,
description: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedDocument( type_: String, id: String, title: String, document_file_id: String, description: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be document
- id
-
Unique identifier for this result, 1-64 bytes
- title
-
Title for the result
- document_file_id
-
A valid file identifier for the file
- description
-
Optional. Short description of the result
- caption
-
Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the file
Official reference: 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 specified content instead of the animation.
pub type InlineQueryResultCachedGif {
InlineQueryResultCachedGif(
type_: String,
id: String,
gif_file_id: String,
title: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedGif( type_: String, id: String, gif_file_id: String, title: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be gif
- id
-
Unique identifier for this result, 1-64 bytes
- gif_file_id
-
A valid file identifier for the GIF file
- title
-
Optional. Title for the result
- caption
-
Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the GIF animation
Official reference: 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.
pub type InlineQueryResultCachedMpeg4Gif {
InlineQueryResultCachedMpeg4Gif(
type_: String,
id: String,
mpeg4_file_id: String,
title: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedMpeg4Gif( type_: String, id: String, mpeg4_file_id: String, title: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be mpeg4_gif
- id
-
Unique identifier for this result, 1-64 bytes
- mpeg4_file_id
-
A valid file identifier for the MPEG4 file
- title
-
Optional. Title for the result
- caption
-
Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the video animation
Official reference: 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.
pub type InlineQueryResultCachedPhoto {
InlineQueryResultCachedPhoto(
type_: String,
id: String,
photo_file_id: String,
title: Option(String),
description: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedPhoto( type_: String, id: String, photo_file_id: String, title: Option(String), description: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be photo
- id
-
Unique identifier for this result, 1-64 bytes
- photo_file_id
-
A valid file identifier of the photo
- title
-
Optional. Title for the result
- description
-
Optional. Short description of the result
- caption
-
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the photo
Official reference: 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.
pub type InlineQueryResultCachedSticker {
InlineQueryResultCachedSticker(
type_: String,
id: String,
sticker_file_id: String,
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedSticker( type_: String, id: String, sticker_file_id: String, reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be sticker
- id
-
Unique identifier for this result, 1-64 bytes
- sticker_file_id
-
A valid file identifier of the sticker
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the sticker
Official reference: 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.
pub type InlineQueryResultCachedVideo {
InlineQueryResultCachedVideo(
type_: String,
id: String,
video_file_id: String,
title: String,
description: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedVideo( type_: String, id: String, video_file_id: String, title: String, description: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be video
- id
-
Unique identifier for this result, 1-64 bytes
- video_file_id
-
A valid file identifier for the video file
- title
-
Title for the result
- description
-
Optional. Short description of the result
- caption
-
Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the video caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the video
Official reference: 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.
pub type InlineQueryResultCachedVoice {
InlineQueryResultCachedVoice(
type_: String,
id: String,
voice_file_id: String,
title: String,
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultCachedVoice( type_: String, id: String, voice_file_id: String, title: String, caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be voice
- id
-
Unique identifier for this result, 1-64 bytes
- voice_file_id
-
A valid file identifier for the voice message
- title
-
Voice message title
- caption
-
Optional. Caption, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the voice message
Official reference: 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.
pub type InlineQueryResultContact {
InlineQueryResultContact(
type_: String,
id: String,
phone_number: String,
first_name: String,
last_name: Option(String),
vcard: Option(String),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
thumbnail_url: Option(String),
thumbnail_width: Option(Int),
thumbnail_height: Option(Int),
)
}
Constructors
-
InlineQueryResultContact( type_: String, id: String, phone_number: String, first_name: String, last_name: Option(String), vcard: Option(String), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), thumbnail_url: Option(String), thumbnail_width: Option(Int), thumbnail_height: Option(Int), )
Arguments
- type_
-
Type of the result, must be contact
- id
-
Unique identifier for this result, 1-64 Bytes
- phone_number
-
Contact’s phone number
- first_name
-
Contact’s first name
- last_name
-
Optional. Contact’s last name
- vcard
-
Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the contact
- thumbnail_url
-
Optional. Url of the thumbnail for the result
- thumbnail_width
-
Optional. Thumbnail width
- thumbnail_height
-
Optional. Thumbnail height
Official reference: 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. Currently, only .PDF and .ZIP files can be sent using this method.
pub type InlineQueryResultDocument {
InlineQueryResultDocument(
type_: String,
id: String,
title: String,
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
document_url: String,
mime_type: String,
description: Option(String),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
thumbnail_url: Option(String),
thumbnail_width: Option(Int),
thumbnail_height: Option(Int),
)
}
Constructors
-
InlineQueryResultDocument( type_: String, id: String, title: String, caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), document_url: String, mime_type: String, description: Option(String), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), thumbnail_url: Option(String), thumbnail_width: Option(Int), thumbnail_height: Option(Int), )
Arguments
- type_
-
Type of the result, must be document
- id
-
Unique identifier for this result, 1-64 bytes
- title
-
Title for the result
- caption
-
Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- document_url
-
A valid URL for the file
- mime_type
-
MIME type of the content of the file, either “application/pdf” or “application/zip”
- description
-
Optional. Short description of the result
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the file
- thumbnail_url
-
Optional. URL of the thumbnail (JPEG only) for the file
- thumbnail_width
-
Optional. Thumbnail width
- thumbnail_height
-
Optional. Thumbnail height
Official reference: Represents a Game.
pub type InlineQueryResultGame {
InlineQueryResultGame(
type_: String,
id: String,
game_short_name: String,
reply_markup: Option(InlineKeyboardMarkup),
)
}
Constructors
-
InlineQueryResultGame( type_: String, id: String, game_short_name: String, reply_markup: Option(InlineKeyboardMarkup), )
Arguments
- type_
-
Type of the result, must be game
- id
-
Unique identifier for this result, 1-64 bytes
- game_short_name
-
Short name of the game
- reply_markup
-
Optional. Inline keyboard attached to the message
Official reference: 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.
pub type InlineQueryResultGif {
InlineQueryResultGif(
type_: String,
id: String,
gif_url: String,
gif_width: Option(Int),
gif_height: Option(Int),
gif_duration: Option(Int),
thumbnail_url: String,
thumbnail_mime_type: Option(String),
title: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultGif( type_: String, id: String, gif_url: String, gif_width: Option(Int), gif_height: Option(Int), gif_duration: Option(Int), thumbnail_url: String, thumbnail_mime_type: Option(String), title: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be gif
- id
-
Unique identifier for this result, 1-64 bytes
- gif_url
-
A valid URL for the GIF file
- gif_width
-
Optional. Width of the GIF
- gif_height
-
Optional. Height of the GIF
- gif_duration
-
Optional. Duration of the GIF in seconds
- thumbnail_url
-
URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
- thumbnail_mime_type
-
Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
- title
-
Optional. Title for the result
- caption
-
Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the GIF animation
Official reference: 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.
pub type InlineQueryResultLocation {
InlineQueryResultLocation(
type_: String,
id: String,
latitude: Float,
longitude: Float,
title: String,
horizontal_accuracy: Option(Float),
live_period: Option(Int),
heading: Option(Int),
proximity_alert_radius: Option(Int),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
thumbnail_url: Option(String),
thumbnail_width: Option(Int),
thumbnail_height: Option(Int),
)
}
Constructors
-
InlineQueryResultLocation( type_: String, id: String, latitude: Float, longitude: Float, title: String, horizontal_accuracy: Option(Float), live_period: Option(Int), heading: Option(Int), proximity_alert_radius: Option(Int), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), thumbnail_url: Option(String), thumbnail_width: Option(Int), thumbnail_height: Option(Int), )
Arguments
- type_
-
Type of the result, must be location
- id
-
Unique identifier for this result, 1-64 Bytes
- latitude
-
Location latitude in degrees
- longitude
-
Location longitude in degrees
- title
-
Location title
- horizontal_accuracy
-
Optional. The radius of uncertainty for the location, measured in meters; 0-1500
- live_period
-
Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
- heading
-
Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
- proximity_alert_radius
-
Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the location
- thumbnail_url
-
Optional. Url of the thumbnail for the result
- thumbnail_width
-
Optional. Thumbnail width
- thumbnail_height
-
Optional. Thumbnail height
Official reference: 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.
pub type InlineQueryResultMpeg4Gif {
InlineQueryResultMpeg4Gif(
type_: String,
id: String,
mpeg4_url: String,
mpeg4_width: Option(Int),
mpeg4_height: Option(Int),
mpeg4_duration: Option(Int),
thumbnail_url: String,
thumbnail_mime_type: Option(String),
title: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultMpeg4Gif( type_: String, id: String, mpeg4_url: String, mpeg4_width: Option(Int), mpeg4_height: Option(Int), mpeg4_duration: Option(Int), thumbnail_url: String, thumbnail_mime_type: Option(String), title: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be mpeg4_gif
- id
-
Unique identifier for this result, 1-64 bytes
- mpeg4_url
-
A valid URL for the MPEG4 file
- mpeg4_width
-
Optional. Video width
- mpeg4_height
-
Optional. Video height
- mpeg4_duration
-
Optional. Video duration in seconds
- thumbnail_url
-
URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
- thumbnail_mime_type
-
Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
- title
-
Optional. Title for the result
- caption
-
Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the video animation
Official reference: 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.
pub type InlineQueryResultPhoto {
InlineQueryResultPhoto(
type_: String,
id: String,
photo_url: String,
thumbnail_url: String,
photo_width: Option(Int),
photo_height: Option(Int),
title: Option(String),
description: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultPhoto( type_: String, id: String, photo_url: String, thumbnail_url: String, photo_width: Option(Int), photo_height: Option(Int), title: Option(String), description: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be photo
- id
-
Unique identifier for this result, 1-64 bytes
- photo_url
-
A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB
- thumbnail_url
-
URL of the thumbnail for the photo
- photo_width
-
Optional. Width of the photo
- photo_height
-
Optional. Height of the photo
- title
-
Optional. Title for the result
- description
-
Optional. Short description of the result
- caption
-
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the photo
Official reference: 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.
pub type InlineQueryResultVenue {
InlineQueryResultVenue(
type_: String,
id: String,
latitude: Float,
longitude: Float,
title: String,
address: String,
foursquare_id: Option(String),
foursquare_type: Option(String),
google_place_id: Option(String),
google_place_type: Option(String),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
thumbnail_url: Option(String),
thumbnail_width: Option(Int),
thumbnail_height: Option(Int),
)
}
Constructors
-
InlineQueryResultVenue( type_: String, id: String, latitude: Float, longitude: Float, title: String, address: String, foursquare_id: Option(String), foursquare_type: Option(String), google_place_id: Option(String), google_place_type: Option(String), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), thumbnail_url: Option(String), thumbnail_width: Option(Int), thumbnail_height: Option(Int), )
Arguments
- type_
-
Type of the result, must be venue
- id
-
Unique identifier for this result, 1-64 Bytes
- latitude
-
Latitude of the venue location in degrees
- longitude
-
Longitude of the venue location in degrees
- title
-
Title of the venue
- address
-
Address of the venue
- foursquare_id
-
Optional. Foursquare identifier of the venue if known
- foursquare_type
-
Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
- google_place_id
-
Optional. Google Places identifier of the venue
- google_place_type
-
Optional. Google Places type of the venue. (See supported types.)
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the venue
- thumbnail_url
-
Optional. Url of the thumbnail for the result
- thumbnail_width
-
Optional. Thumbnail width
- thumbnail_height
-
Optional. Thumbnail height
Official reference: 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.
pub type InlineQueryResultVideo {
InlineQueryResultVideo(
type_: String,
id: String,
video_url: String,
mime_type: String,
thumbnail_url: String,
title: String,
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
video_width: Option(Int),
video_height: Option(Int),
video_duration: Option(Int),
description: Option(String),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultVideo( type_: String, id: String, video_url: String, mime_type: String, thumbnail_url: String, title: String, caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), video_width: Option(Int), video_height: Option(Int), video_duration: Option(Int), description: Option(String), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be video
- id
-
Unique identifier for this result, 1-64 bytes
- video_url
-
A valid URL for the embedded video player or video file
- mime_type
-
MIME type of the content of the video URL, “text/html” or “video/mp4”
- thumbnail_url
-
URL of the thumbnail (JPEG only) for the video
- title
-
Title for the result
- caption
-
Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the video caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- video_width
-
Optional. Video width
- video_height
-
Optional. Video height
- video_duration
-
Optional. Video duration in seconds
- description
-
Optional. Short description of the result
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).
Official reference: 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 the voice message.
pub type InlineQueryResultVoice {
InlineQueryResultVoice(
type_: String,
id: String,
voice_url: String,
title: String,
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
voice_duration: Option(Int),
reply_markup: Option(InlineKeyboardMarkup),
input_message_content: Option(InputMessageContent),
)
}
Constructors
-
InlineQueryResultVoice( type_: String, id: String, voice_url: String, title: String, caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), voice_duration: Option(Int), reply_markup: Option(InlineKeyboardMarkup), input_message_content: Option(InputMessageContent), )
Arguments
- type_
-
Type of the result, must be voice
- id
-
Unique identifier for this result, 1-64 bytes
- voice_url
-
A valid URL for the voice recording
- title
-
Recording title
- caption
-
Optional. Caption, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- voice_duration
-
Optional. Recording duration in seconds
- reply_markup
-
Optional. Inline keyboard attached to the message
- input_message_content
-
Optional. Content of the message to be sent instead of the voice recording
Official reference: This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
pub type InlineQueryResultsButton {
InlineQueryResultsButton(
text: String,
web_app: Option(WebAppInfo),
start_parameter: Option(String),
)
}
Constructors
-
InlineQueryResultsButton( text: String, web_app: Option(WebAppInfo), start_parameter: Option(String), )
Arguments
- text
-
Label text on the button
- web_app
-
Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App.
- start_parameter
-
Optional. Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a ‘Connect your YouTube account’ button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot’s inline capabilities.
Official reference: Represents the content of a contact message to be sent as the result of an inline query.
pub type InputContactMessageContent {
InputContactMessageContent(
phone_number: String,
first_name: String,
last_name: Option(String),
vcard: Option(String),
)
}
Constructors
-
InputContactMessageContent( phone_number: String, first_name: String, last_name: Option(String), vcard: Option(String), )
Arguments
- phone_number
-
Contact’s phone number
- first_name
-
Contact’s first name
- last_name
-
Optional. Contact’s last name
- vcard
-
Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
Official reference: Represents the content of an invoice message to be sent as the result of an inline query.
pub type InputInvoiceMessageContent {
InputInvoiceMessageContent(
title: String,
description: String,
payload: String,
provider_token: Option(String),
currency: String,
prices: List(LabeledPrice),
max_tip_amount: Option(Int),
suggested_tip_amounts: Option(List(Int)),
provider_data: Option(String),
photo_url: Option(String),
photo_size: Option(Int),
photo_width: Option(Int),
photo_height: Option(Int),
need_name: Option(Bool),
need_phone_number: Option(Bool),
need_email: Option(Bool),
need_shipping_address: Option(Bool),
send_phone_number_to_provider: Option(Bool),
send_email_to_provider: Option(Bool),
is_flexible: Option(Bool),
)
}
Constructors
-
InputInvoiceMessageContent( title: String, description: String, payload: String, provider_token: Option(String), currency: String, prices: List(LabeledPrice), max_tip_amount: Option(Int), suggested_tip_amounts: Option(List(Int)), provider_data: Option(String), photo_url: Option(String), photo_size: Option(Int), photo_width: Option(Int), photo_height: Option(Int), need_name: Option(Bool), need_phone_number: Option(Bool), need_email: Option(Bool), need_shipping_address: Option(Bool), send_phone_number_to_provider: Option(Bool), send_email_to_provider: Option(Bool), is_flexible: Option(Bool), )
Arguments
- title
-
Product name, 1-32 characters
- description
-
Product description, 1-255 characters
- payload
-
Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
- provider_token
-
Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
- currency
-
Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
- prices
-
Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
- max_tip_amount
-
Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.
- suggested_tip_amounts
-
Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
- provider_data
-
Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
- photo_url
-
Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
- photo_size
-
Optional. Photo size in bytes
- photo_width
-
Optional. Photo width
- photo_height
-
Optional. Photo height
- need_name
-
Optional. Pass True if you require the user’s full name to complete the order. Ignored for payments in Telegram Stars.
- need_phone_number
-
Optional. Pass True if you require the user’s phone number to complete the order. Ignored for payments in Telegram Stars.
- need_email
-
Optional. Pass True if you require the user’s email address to complete the order. Ignored for payments in Telegram Stars.
- need_shipping_address
-
Optional. Pass True if you require the user’s shipping address to complete the order. Ignored for payments in Telegram Stars.
- send_phone_number_to_provider
-
Optional. Pass True if the user’s phone number should be sent to the provider. Ignored for payments in Telegram Stars.
- send_email_to_provider
-
Optional. Pass True if the user’s email address should be sent to the provider. Ignored for payments in Telegram Stars.
- is_flexible
-
Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
Official reference: Represents the content of a location message to be sent as the result of an inline query.
pub type InputLocationMessageContent {
InputLocationMessageContent(
latitude: Float,
longitude: Float,
horizontal_accuracy: Option(Float),
live_period: Option(Int),
heading: Option(Int),
proximity_alert_radius: Option(Int),
)
}
Constructors
-
InputLocationMessageContent( latitude: Float, longitude: Float, horizontal_accuracy: Option(Float), live_period: Option(Int), heading: Option(Int), proximity_alert_radius: Option(Int), )
Arguments
- latitude
-
Latitude of the location in degrees
- longitude
-
Longitude of the location in degrees
- horizontal_accuracy
-
Optional. The radius of uncertainty for the location, measured in meters; 0-1500
- live_period
-
Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
- heading
-
Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
- proximity_alert_radius
-
Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
pub type InputMedia {
InputMediaAnimationInputMedia(InputMediaAnimation)
InputMediaDocumentInputMedia(InputMediaDocument)
InputMediaAudioInputMedia(InputMediaAudio)
InputMediaPhotoInputMedia(InputMediaPhoto)
InputMediaVideoInputMedia(InputMediaVideo)
}
Constructors
-
InputMediaAnimationInputMedia(InputMediaAnimation)
-
InputMediaDocumentInputMedia(InputMediaDocument)
-
InputMediaAudioInputMedia(InputMediaAudio)
-
InputMediaPhotoInputMedia(InputMediaPhoto)
-
InputMediaVideoInputMedia(InputMediaVideo)
Official reference: Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
pub type InputMediaAnimation {
InputMediaAnimation(
type_: String,
media: String,
thumbnail: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
width: Option(Int),
height: Option(Int),
duration: Option(Int),
has_spoiler: Option(Bool),
)
}
Constructors
-
InputMediaAnimation( type_: String, media: String, thumbnail: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), width: Option(Int), height: Option(Int), duration: Option(Int), has_spoiler: Option(Bool), )
Arguments
- type_
-
Type of the result, must be animation
- media
-
File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- thumbnail
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
- caption
-
Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the animation caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- width
-
Optional. Animation width
- height
-
Optional. Animation height
- duration
-
Optional. Animation duration in seconds
- has_spoiler
-
Optional. Pass True if the animation needs to be covered with a spoiler animation
Official reference: Represents an audio file to be treated as music to be sent.
pub type InputMediaAudio {
InputMediaAudio(
type_: String,
media: String,
thumbnail: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
duration: Option(Int),
performer: Option(String),
title: Option(String),
)
}
Constructors
-
InputMediaAudio( type_: String, media: String, thumbnail: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), duration: Option(Int), performer: Option(String), title: Option(String), )
Arguments
- type_
-
Type of the result, must be audio
- media
-
File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- thumbnail
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
- caption
-
Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- duration
-
Optional. Duration of the audio in seconds
- performer
-
Optional. Performer of the audio
- title
-
Optional. Title of the audio
Official reference: Represents a general file to be sent.
pub type InputMediaDocument {
InputMediaDocument(
type_: String,
media: String,
thumbnail: Option(String),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
disable_content_type_detection: Option(Bool),
)
}
Constructors
-
InputMediaDocument( type_: String, media: String, thumbnail: Option(String), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), disable_content_type_detection: Option(Bool), )
Arguments
- type_
-
Type of the result, must be document
- media
-
File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- thumbnail
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
- caption
-
Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- disable_content_type_detection
-
Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
Official reference: Represents a photo to be sent.
pub type InputMediaPhoto {
InputMediaPhoto(
type_: String,
media: String,
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
has_spoiler: Option(Bool),
)
}
Constructors
-
InputMediaPhoto( type_: String, media: String, caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), has_spoiler: Option(Bool), )
Arguments
- type_
-
Type of the result, must be photo
- media
-
File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- caption
-
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- has_spoiler
-
Optional. Pass True if the photo needs to be covered with a spoiler animation
Official reference: Represents a video to be sent.
pub type InputMediaVideo {
InputMediaVideo(
type_: String,
media: String,
thumbnail: Option(String),
cover: Option(String),
start_timestamp: Option(Int),
caption: Option(String),
parse_mode: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
width: Option(Int),
height: Option(Int),
duration: Option(Int),
supports_streaming: Option(Bool),
has_spoiler: Option(Bool),
)
}
Constructors
-
InputMediaVideo( type_: String, media: String, thumbnail: Option(String), cover: Option(String), start_timestamp: Option(Int), caption: Option(String), parse_mode: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), width: Option(Int), height: Option(Int), duration: Option(Int), supports_streaming: Option(Bool), has_spoiler: Option(Bool), )
Arguments
- type_
-
Type of the result, must be video
- media
-
File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- thumbnail
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
- cover
-
Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- start_timestamp
-
Optional. Start timestamp for the video in the message
- caption
-
Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
- parse_mode
-
Optional. Mode for parsing entities in the video caption. See formatting options for more details.
- caption_entities
-
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- show_caption_above_media
-
Optional. Pass True, if the caption must be shown above the message media
- width
-
Optional. Video width
- height
-
Optional. Video height
- duration
-
Optional. Video duration in seconds
- supports_streaming
-
Optional. Pass True if the uploaded video is suitable for streaming
- has_spoiler
-
Optional. Pass True if the video needs to be covered with a spoiler animation
pub type InputMessageContent {
InputTextMessageContentInputMessageContent(
InputTextMessageContent,
)
InputLocationMessageContentInputMessageContent(
InputLocationMessageContent,
)
InputVenueMessageContentInputMessageContent(
InputVenueMessageContent,
)
InputContactMessageContentInputMessageContent(
InputContactMessageContent,
)
InputInvoiceMessageContentInputMessageContent(
InputInvoiceMessageContent,
)
}
Constructors
-
InputTextMessageContentInputMessageContent( InputTextMessageContent, )
-
InputLocationMessageContentInputMessageContent( InputLocationMessageContent, )
-
InputVenueMessageContentInputMessageContent( InputVenueMessageContent, )
-
InputContactMessageContentInputMessageContent( InputContactMessageContent, )
-
InputInvoiceMessageContentInputMessageContent( InputInvoiceMessageContent, )
pub type InputPaidMedia {
InputPaidMediaPhotoInputPaidMedia(InputPaidMediaPhoto)
InputPaidMediaVideoInputPaidMedia(InputPaidMediaVideo)
}
Constructors
-
InputPaidMediaPhotoInputPaidMedia(InputPaidMediaPhoto)
-
InputPaidMediaVideoInputPaidMedia(InputPaidMediaVideo)
Official reference: The paid media to send is a photo.
pub type InputPaidMediaPhoto {
InputPaidMediaPhoto(type_: String, media: String)
}
Constructors
-
InputPaidMediaPhoto(type_: String, media: String)
Arguments
- type_
-
Type of the media, must be photo
- media
-
File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
Official reference: The paid media to send is a video.
pub type InputPaidMediaVideo {
InputPaidMediaVideo(
type_: String,
media: String,
thumbnail: Option(String),
cover: Option(String),
start_timestamp: Option(Int),
width: Option(Int),
height: Option(Int),
duration: Option(Int),
supports_streaming: Option(Bool),
)
}
Constructors
-
InputPaidMediaVideo( type_: String, media: String, thumbnail: Option(String), cover: Option(String), start_timestamp: Option(Int), width: Option(Int), height: Option(Int), duration: Option(Int), supports_streaming: Option(Bool), )
Arguments
- type_
-
Type of the media, must be video
- media
-
File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- thumbnail
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
- cover
-
Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
- start_timestamp
-
Optional. Start timestamp for the video in the message
- width
-
Optional. Video width
- height
-
Optional. Video height
- duration
-
Optional. Video duration in seconds
- supports_streaming
-
Optional. Pass True if the uploaded video is suitable for streaming
Official reference: This object contains information about one answer option in a poll to be sent.
pub type InputPollOption {
InputPollOption(
text: String,
text_parse_mode: Option(String),
text_entities: Option(List(MessageEntity)),
)
}
Constructors
-
InputPollOption( text: String, text_parse_mode: Option(String), text_entities: Option(List(MessageEntity)), )
Arguments
- text
-
Option text, 1-100 characters
- text_parse_mode
-
Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed
- text_entities
-
Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode
Official reference: This object describes a sticker to be added to a sticker set.
pub type InputSticker {
InputSticker(
sticker: FileOrString,
format: String,
emoji_list: List(String),
mask_position: Option(MaskPosition),
keywords: Option(List(String)),
)
}
Constructors
-
InputSticker( sticker: FileOrString, format: String, emoji_list: List(String), mask_position: Option(MaskPosition), keywords: Option(List(String)), )
Arguments
- sticker
-
The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can’t be uploaded via HTTP URL. More information on Sending Files »
- format
-
Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video
- emoji_list
-
List of 1-20 emoji associated with the sticker
- mask_position
-
Optional. Position where the mask should be placed on faces. For “mask” stickers only.
- keywords
-
Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.
Official reference: Represents the content of a text message to be sent as the result of an inline query.
pub type InputTextMessageContent {
InputTextMessageContent(
message_text: String,
parse_mode: Option(String),
entities: Option(List(MessageEntity)),
link_preview_options: Option(LinkPreviewOptions),
)
}
Constructors
-
InputTextMessageContent( message_text: String, parse_mode: Option(String), entities: Option(List(MessageEntity)), link_preview_options: Option(LinkPreviewOptions), )
Arguments
- message_text
-
Text of the message to be sent, 1-4096 characters
- parse_mode
-
Optional. Mode for parsing entities in the message text. See formatting options for more details.
- entities
-
Optional. List of special entities that appear in message text, which can be specified instead of parse_mode
- link_preview_options
-
Optional. Link preview generation options for the message
Official reference: Represents the content of a venue message to be sent as the result of an inline query.
pub type InputVenueMessageContent {
InputVenueMessageContent(
latitude: Float,
longitude: Float,
title: String,
address: String,
foursquare_id: Option(String),
foursquare_type: Option(String),
google_place_id: Option(String),
google_place_type: Option(String),
)
}
Constructors
-
InputVenueMessageContent( latitude: Float, longitude: Float, title: String, address: String, foursquare_id: Option(String), foursquare_type: Option(String), google_place_id: Option(String), google_place_type: Option(String), )
Arguments
- latitude
-
Latitude of the venue in degrees
- longitude
-
Longitude of the venue in degrees
- title
-
Name of the venue
- address
-
Address of the venue
- foursquare_id
-
Optional. Foursquare identifier of the venue, if known
- foursquare_type
-
Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
- google_place_id
-
Optional. Google Places identifier of the venue
- google_place_type
-
Optional. Google Places type of the venue. (See supported types.)
pub type IntOrString {
Int(value: Int)
Str(value: String)
}
Constructors
-
Int(value: Int)
-
Str(value: String)
Official reference: This object contains basic information about an invoice.
pub type Invoice {
Invoice(
title: String,
description: String,
start_parameter: String,
currency: String,
total_amount: Int,
)
}
Constructors
-
Invoice( title: String, description: String, start_parameter: String, currency: String, total_amount: Int, )
Arguments
- title
-
Product name
- description
-
Product description
- start_parameter
-
Unique bot deep-linking parameter that can be used to generate this invoice
- currency
-
Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
- total_amount
-
Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
Official reference: This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
pub type KeyboardButton {
KeyboardButton(
text: String,
request_users: Option(KeyboardButtonRequestUsers),
request_chat: Option(KeyboardButtonRequestChat),
request_contact: Option(Bool),
request_location: Option(Bool),
request_poll: Option(KeyboardButtonPollType),
web_app: Option(WebAppInfo),
)
}
Constructors
-
KeyboardButton( text: String, request_users: Option(KeyboardButtonRequestUsers), request_chat: Option(KeyboardButtonRequestChat), request_contact: Option(Bool), request_location: Option(Bool), request_poll: Option(KeyboardButtonPollType), web_app: Option(WebAppInfo), )
Arguments
- text
-
Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
- request_users
-
Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
- request_chat
-
Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
- request_contact
-
Optional. If True, the user’s phone number will be sent as a contact when the button is pressed. Available in private chats only.
- request_location
-
Optional. If True, the user’s current location will be sent when the button is pressed. Available in private chats only.
- request_poll
-
Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.
- web_app
-
Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
Official reference: This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
pub type KeyboardButtonPollType {
KeyboardButtonPollType(type_: Option(String))
}
Constructors
-
KeyboardButtonPollType(type_: Option(String))
Arguments
- type_
-
Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
Official reference: This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».
pub type KeyboardButtonRequestChat {
KeyboardButtonRequestChat(
request_id: Int,
chat_is_channel: Bool,
chat_is_forum: Option(Bool),
chat_has_username: Option(Bool),
chat_is_created: Option(Bool),
user_administrator_rights: Option(ChatAdministratorRights),
bot_administrator_rights: Option(ChatAdministratorRights),
bot_is_member: Option(Bool),
request_title: Option(Bool),
request_username: Option(Bool),
request_photo: Option(Bool),
)
}
Constructors
-
KeyboardButtonRequestChat( request_id: Int, chat_is_channel: Bool, chat_is_forum: Option(Bool), chat_has_username: Option(Bool), chat_is_created: Option(Bool), user_administrator_rights: Option(ChatAdministratorRights), bot_administrator_rights: Option(ChatAdministratorRights), bot_is_member: Option(Bool), request_title: Option(Bool), request_username: Option(Bool), request_photo: Option(Bool), )
Arguments
- request_id
-
Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message
- chat_is_channel
-
Pass True to request a channel chat, pass False to request a group or a supergroup chat.
- chat_is_forum
-
Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
- chat_has_username
-
Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.
- chat_is_created
-
Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.
- user_administrator_rights
-
Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.
- bot_administrator_rights
-
Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.
- bot_is_member
-
Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
- request_title
-
Optional. Pass True to request the chat’s title
- request_username
-
Optional. Pass True to request the chat’s username
- request_photo
-
Optional. Pass True to request the chat’s photo
Official reference: This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »
pub type KeyboardButtonRequestUsers {
KeyboardButtonRequestUsers(
request_id: Int,
user_is_bot: Option(Bool),
user_is_premium: Option(Bool),
max_quantity: Option(Int),
request_name: Option(Bool),
request_username: Option(Bool),
request_photo: Option(Bool),
)
}
Constructors
-
KeyboardButtonRequestUsers( request_id: Int, user_is_bot: Option(Bool), user_is_premium: Option(Bool), max_quantity: Option(Int), request_name: Option(Bool), request_username: Option(Bool), request_photo: Option(Bool), )
Arguments
- request_id
-
Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message
- user_is_bot
-
Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.
- user_is_premium
-
Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.
- max_quantity
-
Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
- request_name
-
Optional. Pass True to request the users’ first and last names
- request_username
-
Optional. Pass True to request the users’ usernames
- request_photo
-
Optional. Pass True to request the users’ photos
Official reference: This object represents a portion of the price for goods or services.
pub type LabeledPrice {
LabeledPrice(label: String, amount: Int)
}
Constructors
-
LabeledPrice(label: String, amount: Int)
Arguments
- label
-
Portion label
- amount
-
Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
Official reference: Describes the options used for link preview generation.
pub type LinkPreviewOptions {
LinkPreviewOptions(
is_disabled: Option(Bool),
url: Option(String),
prefer_small_media: Option(Bool),
prefer_large_media: Option(Bool),
show_above_text: Option(Bool),
)
}
Constructors
-
LinkPreviewOptions( is_disabled: Option(Bool), url: Option(String), prefer_small_media: Option(Bool), prefer_large_media: Option(Bool), show_above_text: Option(Bool), )
Arguments
- is_disabled
-
Optional. True, if the link preview is disabled
- url
-
Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
- prefer_small_media
-
Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn’t explicitly specified or media size change isn’t supported for the preview
- prefer_large_media
-
Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn’t explicitly specified or media size change isn’t supported for the preview
- show_above_text
-
Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
Official reference: This object represents a point on the map.
pub type Location {
Location(
latitude: Float,
longitude: Float,
horizontal_accuracy: Option(Float),
live_period: Option(Int),
heading: Option(Int),
proximity_alert_radius: Option(Int),
)
}
Constructors
-
Location( latitude: Float, longitude: Float, horizontal_accuracy: Option(Float), live_period: Option(Int), heading: Option(Int), proximity_alert_radius: Option(Int), )
Arguments
- latitude
-
Latitude as defined by the sender
- longitude
-
Longitude as defined by the sender
- horizontal_accuracy
-
Optional. The radius of uncertainty for the location, measured in meters; 0-1500
- live_period
-
Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
- heading
-
Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
- proximity_alert_radius
-
Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
Official reference: This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:
pub type LoginUrl {
LoginUrl(
url: String,
forward_text: Option(String),
bot_username: Option(String),
request_write_access: Option(Bool),
)
}
Constructors
-
LoginUrl( url: String, forward_text: Option(String), bot_username: Option(String), request_write_access: Option(Bool), )
Arguments
- url
-
An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
- forward_text
-
Optional. New text of the button in forwarded messages.
- bot_username
-
Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot’s username will be assumed. The url’s domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
- request_write_access
-
Optional. Pass True to request the permission for your bot to send messages to the user.
Official reference: This object describes the position on faces where a mask should be placed by default.
pub type MaskPosition {
MaskPosition(
point: String,
x_shift: Float,
y_shift: Float,
scale: Float,
)
}
Constructors
-
MaskPosition( point: String, x_shift: Float, y_shift: Float, scale: Float, )
Arguments
- point
-
The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
- x_shift
-
Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
- y_shift
-
Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
- scale
-
Mask scaling coefficient. For example, 2.0 means double size.
pub type MaybeInaccessibleMessage {
MessageMaybeInaccessibleMessage(Message)
InaccessibleMessageMaybeInaccessibleMessage(
InaccessibleMessage,
)
}
Constructors
-
MessageMaybeInaccessibleMessage(Message)
-
InaccessibleMessageMaybeInaccessibleMessage(InaccessibleMessage)
pub type MenuButton {
MenuButtonCommandsMenuButton(MenuButtonCommands)
MenuButtonWebAppMenuButton(MenuButtonWebApp)
MenuButtonDefaultMenuButton(MenuButtonDefault)
}
Constructors
-
MenuButtonCommandsMenuButton(MenuButtonCommands)
-
MenuButtonWebAppMenuButton(MenuButtonWebApp)
-
MenuButtonDefaultMenuButton(MenuButtonDefault)
Official reference: Represents a menu button, which opens the bot’s list of commands.
pub type MenuButtonCommands {
MenuButtonCommands(type_: String)
}
Constructors
-
MenuButtonCommands(type_: String)
Arguments
- type_
-
Type of the button, must be commands
Official reference: Describes that no specific value for the menu button was set.
pub type MenuButtonDefault {
MenuButtonDefault(type_: String)
}
Constructors
-
MenuButtonDefault(type_: String)
Arguments
- type_
-
Type of the button, must be default
Official reference: Represents a menu button, which launches a Web App.
pub type MenuButtonWebApp {
MenuButtonWebApp(
type_: String,
text: String,
web_app: WebAppInfo,
)
}
Constructors
-
MenuButtonWebApp( type_: String, text: String, web_app: WebAppInfo, )
Arguments
- type_
-
Type of the button, must be web_app
- text
-
Text on the button
- web_app
-
Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web App’s URL, in which case the Web App will be opened as if the user pressed the link.
Official reference: This object represents a message.
pub type Message {
Message(
message_id: Int,
message_thread_id: Option(Int),
from: Option(User),
sender_chat: Option(Chat),
sender_boost_count: Option(Int),
sender_business_bot: Option(User),
date: Int,
business_connection_id: Option(String),
chat: Chat,
forward_origin: Option(MessageOrigin),
is_topic_message: Option(Bool),
is_automatic_forward: Option(Bool),
reply_to_message: Option(Message),
external_reply: Option(ExternalReplyInfo),
quote: Option(TextQuote),
reply_to_story: Option(Story),
via_bot: Option(User),
edit_date: Option(Int),
has_protected_content: Option(Bool),
is_from_offline: Option(Bool),
media_group_id: Option(String),
author_signature: Option(String),
text: Option(String),
entities: Option(List(MessageEntity)),
link_preview_options: Option(LinkPreviewOptions),
effect_id: Option(String),
animation: Option(Animation),
audio: Option(Audio),
document: Option(Document),
paid_media: Option(PaidMediaInfo),
photo: Option(List(PhotoSize)),
sticker: Option(Sticker),
story: Option(Story),
video: Option(Video),
video_note: Option(VideoNote),
voice: Option(Voice),
caption: Option(String),
caption_entities: Option(List(MessageEntity)),
show_caption_above_media: Option(Bool),
has_media_spoiler: Option(Bool),
contact: Option(Contact),
dice: Option(Dice),
game: Option(Game),
poll: Option(Poll),
venue: Option(Venue),
location: Option(Location),
new_chat_members: Option(List(User)),
left_chat_member: Option(User),
new_chat_title: Option(String),
new_chat_photo: Option(List(PhotoSize)),
delete_chat_photo: Option(Bool),
group_chat_created: Option(Bool),
supergroup_chat_created: Option(Bool),
channel_chat_created: Option(Bool),
message_auto_delete_timer_changed: Option(
MessageAutoDeleteTimerChanged,
),
migrate_to_chat_id: Option(Int),
migrate_from_chat_id: Option(Int),
pinned_message: Option(MaybeInaccessibleMessage),
invoice: Option(Invoice),
successful_payment: Option(SuccessfulPayment),
refunded_payment: Option(RefundedPayment),
users_shared: Option(UsersShared),
chat_shared: Option(ChatShared),
connected_website: Option(String),
write_access_allowed: Option(WriteAccessAllowed),
passport_data: Option(PassportData),
proximity_alert_triggered: Option(ProximityAlertTriggered),
boost_added: Option(ChatBoostAdded),
chat_background_set: Option(ChatBackground),
forum_topic_created: Option(ForumTopicCreated),
forum_topic_edited: Option(ForumTopicEdited),
forum_topic_closed: Option(ForumTopicClosed),
forum_topic_reopened: Option(ForumTopicReopened),
general_forum_topic_hidden: Option(GeneralForumTopicHidden),
general_forum_topic_unhidden: Option(
GeneralForumTopicUnhidden,
),
giveaway_created: Option(GiveawayCreated),
giveaway: Option(Giveaway),
giveaway_winners: Option(GiveawayWinners),
giveaway_completed: Option(GiveawayCompleted),
video_chat_scheduled: Option(VideoChatScheduled),
video_chat_started: Option(VideoChatStarted),
video_chat_ended: Option(VideoChatEnded),
video_chat_participants_invited: Option(
VideoChatParticipantsInvited,
),
web_app_data: Option(WebAppData),
reply_markup: Option(InlineKeyboardMarkup),
)
}
Constructors
-
Message( message_id: Int, message_thread_id: Option(Int), from: Option(User), sender_chat: Option(Chat), sender_boost_count: Option(Int), sender_business_bot: Option(User), date: Int, business_connection_id: Option(String), chat: Chat, forward_origin: Option(MessageOrigin), is_topic_message: Option(Bool), is_automatic_forward: Option(Bool), reply_to_message: Option(Message), external_reply: Option(ExternalReplyInfo), quote: Option(TextQuote), reply_to_story: Option(Story), via_bot: Option(User), edit_date: Option(Int), has_protected_content: Option(Bool), is_from_offline: Option(Bool), media_group_id: Option(String), author_signature: Option(String), text: Option(String), entities: Option(List(MessageEntity)), link_preview_options: Option(LinkPreviewOptions), effect_id: Option(String), animation: Option(Animation), audio: Option(Audio), document: Option(Document), paid_media: Option(PaidMediaInfo), photo: Option(List(PhotoSize)), sticker: Option(Sticker), story: Option(Story), video: Option(Video), video_note: Option(VideoNote), voice: Option(Voice), caption: Option(String), caption_entities: Option(List(MessageEntity)), show_caption_above_media: Option(Bool), has_media_spoiler: Option(Bool), contact: Option(Contact), dice: Option(Dice), game: Option(Game), poll: Option(Poll), venue: Option(Venue), location: Option(Location), new_chat_members: Option(List(User)), left_chat_member: Option(User), new_chat_title: Option(String), new_chat_photo: Option(List(PhotoSize)), delete_chat_photo: Option(Bool), group_chat_created: Option(Bool), supergroup_chat_created: Option(Bool), channel_chat_created: Option(Bool), message_auto_delete_timer_changed: Option( MessageAutoDeleteTimerChanged, ), migrate_to_chat_id: Option(Int), migrate_from_chat_id: Option(Int), pinned_message: Option(MaybeInaccessibleMessage), invoice: Option(Invoice), successful_payment: Option(SuccessfulPayment), refunded_payment: Option(RefundedPayment), users_shared: Option(UsersShared), chat_shared: Option(ChatShared), connected_website: Option(String), write_access_allowed: Option(WriteAccessAllowed), passport_data: Option(PassportData), proximity_alert_triggered: Option(ProximityAlertTriggered), boost_added: Option(ChatBoostAdded), chat_background_set: Option(ChatBackground), forum_topic_created: Option(ForumTopicCreated), forum_topic_edited: Option(ForumTopicEdited), forum_topic_closed: Option(ForumTopicClosed), forum_topic_reopened: Option(ForumTopicReopened), general_forum_topic_hidden: Option(GeneralForumTopicHidden), general_forum_topic_unhidden: Option(GeneralForumTopicUnhidden), giveaway_created: Option(GiveawayCreated), giveaway: Option(Giveaway), giveaway_winners: Option(GiveawayWinners), giveaway_completed: Option(GiveawayCompleted), video_chat_scheduled: Option(VideoChatScheduled), video_chat_started: Option(VideoChatStarted), video_chat_ended: Option(VideoChatEnded), video_chat_participants_invited: Option( VideoChatParticipantsInvited, ), web_app_data: Option(WebAppData), reply_markup: Option(InlineKeyboardMarkup), )
Arguments
- message_id
-
Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
- message_thread_id
-
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
- from
-
Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
- sender_chat
-
Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel’s discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
- sender_boost_count
-
Optional. If the sender of the message boosted the chat, the number of boosts added by the user
- sender_business_bot
-
Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.
- date
-
Date the message was sent in Unix time. It is always a positive number, representing a valid date.
- business_connection_id
-
Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
- chat
-
Chat the message belongs to
- forward_origin
-
Optional. Information about the original message for forwarded messages
- is_topic_message
-
Optional. True, if the message is sent to a forum topic
- is_automatic_forward
-
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
- reply_to_message
-
Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
- external_reply
-
Optional. Information about the message that is being replied to, which may come from another chat or forum topic
- quote
-
Optional. For replies that quote part of the original message, the quoted part of the message
- reply_to_story
-
Optional. For replies to a story, the original story
- via_bot
-
Optional. Bot through which the message was sent
- edit_date
-
Optional. Date the message was last edited in Unix time
- has_protected_content
-
Optional. True, if the message can’t be forwarded
- is_from_offline
-
Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
- media_group_id
-
Optional. The unique identifier of a media message group this message belongs to
- author_signature
-
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
- text
-
Optional. For text messages, the actual UTF-8 text of the message
- entities
-
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
- link_preview_options
-
Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
- effect_id
-
Optional. Unique identifier of the message effect added to the message
- animation
-
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
- audio
-
Optional. Message is an audio file, information about the file
- document
-
Optional. Message is a general file, information about the file
- paid_media
-
Optional. Message contains paid media; information about the paid media
- photo
-
Optional. Message is a photo, available sizes of the photo
- sticker
-
Optional. Message is a sticker, information about the sticker
- story
-
Optional. Message is a forwarded story
- video
-
Optional. Message is a video, information about the video
- video_note
-
Optional. Message is a video note, information about the video message
- voice
-
Optional. Message is a voice message, information about the file
- caption
-
Optional. Caption for the animation, audio, document, paid media, photo, video or voice
- caption_entities
-
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
- show_caption_above_media
-
Optional. True, if the caption must be shown above the message media
- has_media_spoiler
-
Optional. True, if the message media is covered by a spoiler animation
- contact
-
Optional. Message is a shared contact, information about the contact
- dice
-
Optional. Message is a dice with random value
- game
-
Optional. Message is a game, information about the game. More about games »
- poll
-
Optional. Message is a native poll, information about the poll
- venue
-
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
- location
-
Optional. Message is a shared location, information about the location
- new_chat_members
-
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
- left_chat_member
-
Optional. A member was removed from the group, information about them (this member may be the bot itself)
- new_chat_title
-
Optional. A chat title was changed to this value
- new_chat_photo
-
Optional. A chat photo was change to this value
- delete_chat_photo
-
Optional. Service message: the chat photo was deleted
- group_chat_created
-
Optional. Service message: the group has been created
- supergroup_chat_created
-
Optional. Service message: the supergroup has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
- channel_chat_created
-
Optional. Service message: the channel has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
- message_auto_delete_timer_changed
-
Optional. Service message: auto-delete timer settings changed in the chat
- migrate_to_chat_id
-
Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
- migrate_from_chat_id
-
Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
- pinned_message
-
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
- invoice
-
Optional. Message is an invoice for a payment, information about the invoice. More about payments »
- successful_payment
-
Optional. Message is a service message about a successful payment, information about the payment. More about payments »
- refunded_payment
-
Optional. Message is a service message about a refunded payment, information about the payment. More about payments »
- users_shared
-
Optional. Service message: users were shared with the bot
- chat_shared
-
Optional. Service message: a chat was shared with the bot
- connected_website
-
Optional. The domain name of the website on which the user has logged in. More about Telegram Login »
- write_access_allowed
-
Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess
- passport_data
-
Optional. Telegram Passport data
- proximity_alert_triggered
-
Optional. Service message. A user in the chat triggered another user’s proximity alert while sharing Live Location.
- boost_added
-
Optional. Service message: user boosted the chat
- chat_background_set
-
Optional. Service message: chat background set
- forum_topic_created
-
Optional. Service message: forum topic created
- forum_topic_edited
-
Optional. Service message: forum topic edited
- forum_topic_closed
-
Optional. Service message: forum topic closed
- forum_topic_reopened
-
Optional. Service message: forum topic reopened
- general_forum_topic_hidden
-
Optional. Service message: the ‘General’ forum topic hidden
- general_forum_topic_unhidden
-
Optional. Service message: the ‘General’ forum topic unhidden
- giveaway_created
-
Optional. Service message: a scheduled giveaway was created
- giveaway
-
Optional. The message is a scheduled giveaway message
- giveaway_winners
-
Optional. A giveaway with public winners was completed
- giveaway_completed
-
Optional. Service message: a giveaway without public winners was completed
- video_chat_scheduled
-
Optional. Service message: video chat scheduled
- video_chat_started
-
Optional. Service message: video chat started
- video_chat_ended
-
Optional. Service message: video chat ended
- video_chat_participants_invited
-
Optional. Service message: new participants invited to a video chat
- web_app_data
-
Optional. Service message: data sent by a Web App
- reply_markup
-
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
Official reference: This object represents a service message about a change in auto-delete timer settings.
pub type MessageAutoDeleteTimerChanged {
MessageAutoDeleteTimerChanged(message_auto_delete_time: Int)
}
Constructors
-
MessageAutoDeleteTimerChanged(message_auto_delete_time: Int)
Arguments
- message_auto_delete_time
-
New auto-delete time for messages in the chat; in seconds
Official reference: This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
pub type MessageEntity {
MessageEntity(
type_: String,
offset: Int,
length: Int,
url: Option(String),
user: Option(User),
language: Option(String),
custom_emoji_id: Option(String),
)
}
Constructors
-
MessageEntity( type_: String, offset: Int, length: Int, url: Option(String), user: Option(User), language: Option(String), custom_emoji_id: Option(String), )
Arguments
- type_
-
Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
- offset
-
Offset in UTF-16 code units to the start of the entity
- length
-
Length of the entity in UTF-16 code units
- url
-
Optional. For “text_link” only, URL that will be opened after user taps on the text
- user
-
Optional. For “text_mention” only, the mentioned user
- language
-
Optional. For “pre” only, the programming language of the entity text
- custom_emoji_id
-
Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
Official reference: This object represents a unique message identifier.
pub type MessageId {
MessageId(message_id: Int)
}
Constructors
-
MessageId(message_id: Int)
Arguments
- message_id
-
Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
pub type MessageOrigin {
MessageOriginUserMessageOrigin(MessageOriginUser)
MessageOriginHiddenUserMessageOrigin(MessageOriginHiddenUser)
MessageOriginChatMessageOrigin(MessageOriginChat)
MessageOriginChannelMessageOrigin(MessageOriginChannel)
}
Constructors
-
MessageOriginUserMessageOrigin(MessageOriginUser)
-
MessageOriginHiddenUserMessageOrigin(MessageOriginHiddenUser)
-
MessageOriginChatMessageOrigin(MessageOriginChat)
-
MessageOriginChannelMessageOrigin(MessageOriginChannel)
Official reference: The message was originally sent to a channel chat.
pub type MessageOriginChannel {
MessageOriginChannel(
type_: String,
date: Int,
chat: Chat,
message_id: Int,
author_signature: Option(String),
)
}
Constructors
-
MessageOriginChannel( type_: String, date: Int, chat: Chat, message_id: Int, author_signature: Option(String), )
Arguments
- type_
-
Type of the message origin, always “channel”
- date
-
Date the message was sent originally in Unix time
- chat
-
Channel chat to which the message was originally sent
- message_id
-
Unique message identifier inside the chat
- author_signature
-
Optional. Signature of the original post author
Official reference: The message was originally sent on behalf of a chat to a group chat.
pub type MessageOriginChat {
MessageOriginChat(
type_: String,
date: Int,
sender_chat: Chat,
author_signature: Option(String),
)
}
Constructors
-
MessageOriginChat( type_: String, date: Int, sender_chat: Chat, author_signature: Option(String), )
Arguments
- type_
-
Type of the message origin, always “chat”
- date
-
Date the message was sent originally in Unix time
- sender_chat
-
Chat that sent the message originally
- author_signature
-
Optional. For messages originally sent by an anonymous chat administrator, original message author signature
Official reference: The message was originally sent by an unknown user.
pub type MessageOriginHiddenUser {
MessageOriginHiddenUser(
type_: String,
date: Int,
sender_user_name: String,
)
}
Constructors
-
MessageOriginHiddenUser( type_: String, date: Int, sender_user_name: String, )
Arguments
- type_
-
Type of the message origin, always “hidden_user”
- date
-
Date the message was sent originally in Unix time
- sender_user_name
-
Name of the user that sent the message originally
Official reference: The message was originally sent by a known user.
pub type MessageOriginUser {
MessageOriginUser(type_: String, date: Int, sender_user: User)
}
Constructors
-
MessageOriginUser(type_: String, date: Int, sender_user: User)
Arguments
- type_
-
Type of the message origin, always “user”
- date
-
Date the message was sent originally in Unix time
- sender_user
-
User that sent the message originally
Official reference: This object represents reaction changes on a message with anonymous reactions.
pub type MessageReactionCountUpdated {
MessageReactionCountUpdated(
chat: Chat,
message_id: Int,
date: Int,
reactions: List(ReactionCount),
)
}
Constructors
-
MessageReactionCountUpdated( chat: Chat, message_id: Int, date: Int, reactions: List(ReactionCount), )
Arguments
- chat
-
The chat containing the message
- message_id
-
Unique message identifier inside the chat
- date
-
Date of the change in Unix time
- reactions
-
List of reactions that are present on the message
Official reference: This object represents a change of a reaction on a message performed by a user.
pub type MessageReactionUpdated {
MessageReactionUpdated(
chat: Chat,
message_id: Int,
user: Option(User),
actor_chat: Option(Chat),
date: Int,
old_reaction: List(ReactionType),
new_reaction: List(ReactionType),
)
}
Constructors
-
MessageReactionUpdated( chat: Chat, message_id: Int, user: Option(User), actor_chat: Option(Chat), date: Int, old_reaction: List(ReactionType), new_reaction: List(ReactionType), )
Arguments
- chat
-
The chat containing the message the user reacted to
- message_id
-
Unique identifier of the message inside the chat
- user
-
Optional. The user that changed the reaction, if the user isn’t anonymous
- actor_chat
-
Optional. The chat on behalf of which the reaction was changed, if the user is anonymous
- date
-
Date of the change in Unix time
- old_reaction
-
Previous list of reaction types that were set by the user
- new_reaction
-
New list of reaction types that have been set by the user
Official reference: This object represents information about an order.
pub type OrderInfo {
OrderInfo(
name: Option(String),
phone_number: Option(String),
email: Option(String),
shipping_address: Option(ShippingAddress),
)
}
Constructors
-
OrderInfo( name: Option(String), phone_number: Option(String), email: Option(String), shipping_address: Option(ShippingAddress), )
Arguments
- name
-
Optional. User name
- phone_number
-
Optional. User’s phone number
-
Optional. User email
- shipping_address
-
Optional. User shipping address
pub type PaidMedia {
PaidMediaPreviewPaidMedia(PaidMediaPreview)
PaidMediaPhotoPaidMedia(PaidMediaPhoto)
PaidMediaVideoPaidMedia(PaidMediaVideo)
}
Constructors
-
PaidMediaPreviewPaidMedia(PaidMediaPreview)
-
PaidMediaPhotoPaidMedia(PaidMediaPhoto)
-
PaidMediaVideoPaidMedia(PaidMediaVideo)
Official reference: Describes the paid media added to a message.
pub type PaidMediaInfo {
PaidMediaInfo(star_count: Int, paid_media: List(PaidMedia))
}
Constructors
-
PaidMediaInfo(star_count: Int, paid_media: List(PaidMedia))
Arguments
- star_count
-
The number of Telegram Stars that must be paid to buy access to the media
- paid_media
-
Information about the paid media
Official reference: The paid media is a photo.
pub type PaidMediaPhoto {
PaidMediaPhoto(type_: String, photo: List(PhotoSize))
}
Constructors
-
PaidMediaPhoto(type_: String, photo: List(PhotoSize))
Arguments
- type_
-
Type of the paid media, always “photo”
- photo
-
The photo
Official reference: The paid media isn’t available before the payment.
pub type PaidMediaPreview {
PaidMediaPreview(
type_: String,
width: Option(Int),
height: Option(Int),
duration: Option(Int),
)
}
Constructors
-
PaidMediaPreview( type_: String, width: Option(Int), height: Option(Int), duration: Option(Int), )
Arguments
- type_
-
Type of the paid media, always “preview”
- width
-
Optional. Media width as defined by the sender
- height
-
Optional. Media height as defined by the sender
- duration
-
Optional. Duration of the media in seconds as defined by the sender
Official reference: This object contains information about a paid media purchase.
pub type PaidMediaPurchased {
PaidMediaPurchased(from: User, paid_media_payload: String)
}
Constructors
-
PaidMediaPurchased(from: User, paid_media_payload: String)
Arguments
- from
-
User who purchased the media
- paid_media_payload
-
Bot-specified paid media payload
Official reference: The paid media is a video.
pub type PaidMediaVideo {
PaidMediaVideo(type_: String, video: Video)
}
Constructors
-
PaidMediaVideo(type_: String, video: Video)
Arguments
- type_
-
Type of the paid media, always “video”
- video
-
The video
Official reference: Describes Telegram Passport data shared with the bot by the user.
pub type PassportData {
PassportData(
data: List(EncryptedPassportElement),
credentials: EncryptedCredentials,
)
}
Constructors
-
PassportData( data: List(EncryptedPassportElement), credentials: EncryptedCredentials, )
Arguments
- data
-
Array with information about documents and other Telegram Passport elements that was shared with the bot
- credentials
-
Encrypted credentials required to decrypt the data
pub type PassportElementError {
PassportElementErrorDataFieldPassportElementError(
PassportElementErrorDataField,
)
PassportElementErrorFrontSidePassportElementError(
PassportElementErrorFrontSide,
)
PassportElementErrorReverseSidePassportElementError(
PassportElementErrorReverseSide,
)
PassportElementErrorSelfiePassportElementError(
PassportElementErrorSelfie,
)
PassportElementErrorFilePassportElementError(
PassportElementErrorFile,
)
PassportElementErrorFilesPassportElementError(
PassportElementErrorFiles,
)
PassportElementErrorTranslationFilePassportElementError(
PassportElementErrorTranslationFile,
)
PassportElementErrorTranslationFilesPassportElementError(
PassportElementErrorTranslationFiles,
)
PassportElementErrorUnspecifiedPassportElementError(
PassportElementErrorUnspecified,
)
}
Constructors
-
PassportElementErrorDataFieldPassportElementError( PassportElementErrorDataField, )
-
PassportElementErrorFrontSidePassportElementError( PassportElementErrorFrontSide, )
-
PassportElementErrorReverseSidePassportElementError( PassportElementErrorReverseSide, )
-
PassportElementErrorSelfiePassportElementError( PassportElementErrorSelfie, )
-
PassportElementErrorFilePassportElementError( PassportElementErrorFile, )
-
PassportElementErrorFilesPassportElementError( PassportElementErrorFiles, )
-
PassportElementErrorTranslationFilePassportElementError( PassportElementErrorTranslationFile, )
-
PassportElementErrorTranslationFilesPassportElementError( PassportElementErrorTranslationFiles, )
-
PassportElementErrorUnspecifiedPassportElementError( PassportElementErrorUnspecified, )
Official reference: Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field’s value changes.
pub type PassportElementErrorDataField {
PassportElementErrorDataField(
source: String,
type_: String,
field_name: String,
data_hash: String,
message: String,
)
}
Constructors
-
PassportElementErrorDataField( source: String, type_: String, field_name: String, data_hash: String, message: String, )
Arguments
- source
-
Error source, must be data
- type_
-
The section of the user’s Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
- field_name
-
Name of the data field which has the error
- data_hash
-
Base64-encoded data hash
- message
-
Error message
Official reference: Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
pub type PassportElementErrorFile {
PassportElementErrorFile(
source: String,
type_: String,
file_hash: String,
message: String,
)
}
Constructors
-
PassportElementErrorFile( source: String, type_: String, file_hash: String, message: String, )
Arguments
- source
-
Error source, must be file
- type_
-
The section of the user’s Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
- file_hash
-
Base64-encoded file hash
- message
-
Error message
Official reference: Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
pub type PassportElementErrorFiles {
PassportElementErrorFiles(
source: String,
type_: String,
file_hashes: List(String),
message: String,
)
}
Constructors
-
PassportElementErrorFiles( source: String, type_: String, file_hashes: List(String), message: String, )
Arguments
- source
-
Error source, must be files
- type_
-
The section of the user’s Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
- file_hashes
-
List of base64-encoded file hashes
- message
-
Error message
Official reference: Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
pub type PassportElementErrorFrontSide {
PassportElementErrorFrontSide(
source: String,
type_: String,
file_hash: String,
message: String,
)
}
Constructors
-
PassportElementErrorFrontSide( source: String, type_: String, file_hash: String, message: String, )
Arguments
- source
-
Error source, must be front_side
- type_
-
The section of the user’s Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
- file_hash
-
Base64-encoded hash of the file with the front side of the document
- message
-
Error message
Official reference: Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
pub type PassportElementErrorReverseSide {
PassportElementErrorReverseSide(
source: String,
type_: String,
file_hash: String,
message: String,
)
}
Constructors
-
PassportElementErrorReverseSide( source: String, type_: String, file_hash: String, message: String, )
Arguments
- source
-
Error source, must be reverse_side
- type_
-
The section of the user’s Telegram Passport which has the issue, one of “driver_license”, “identity_card”
- file_hash
-
Base64-encoded hash of the file with the reverse side of the document
- message
-
Error message
Official reference: Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
pub type PassportElementErrorSelfie {
PassportElementErrorSelfie(
source: String,
type_: String,
file_hash: String,
message: String,
)
}
Constructors
-
PassportElementErrorSelfie( source: String, type_: String, file_hash: String, message: String, )
Arguments
- source
-
Error source, must be selfie
- type_
-
The section of the user’s Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
- file_hash
-
Base64-encoded hash of the file with the selfie
- message
-
Error message
Official reference: Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
pub type PassportElementErrorTranslationFile {
PassportElementErrorTranslationFile(
source: String,
type_: String,
file_hash: String,
message: String,
)
}
Constructors
-
PassportElementErrorTranslationFile( source: String, type_: String, file_hash: String, message: String, )
Arguments
- source
-
Error source, must be translation_file
- type_
-
Type of element of the user’s Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
- file_hash
-
Base64-encoded file hash
- message
-
Error message
Official reference: Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
pub type PassportElementErrorTranslationFiles {
PassportElementErrorTranslationFiles(
source: String,
type_: String,
file_hashes: List(String),
message: String,
)
}
Constructors
-
PassportElementErrorTranslationFiles( source: String, type_: String, file_hashes: List(String), message: String, )
Arguments
- source
-
Error source, must be translation_files
- type_
-
Type of element of the user’s Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
- file_hashes
-
List of base64-encoded file hashes
- message
-
Error message
Official reference: Represents an issue in an unspecified place. The error is considered resolved when new data is added.
pub type PassportElementErrorUnspecified {
PassportElementErrorUnspecified(
source: String,
type_: String,
element_hash: String,
message: String,
)
}
Constructors
-
PassportElementErrorUnspecified( source: String, type_: String, element_hash: String, message: String, )
Arguments
- source
-
Error source, must be unspecified
- type_
-
Type of element of the user’s Telegram Passport which has the issue
- element_hash
-
Base64-encoded element hash
- message
-
Error message
Official reference: 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.
pub type PassportFile {
PassportFile(
file_id: String,
file_unique_id: String,
file_size: Int,
file_date: Int,
)
}
Constructors
-
PassportFile( file_id: String, file_unique_id: String, file_size: Int, file_date: Int, )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- file_size
-
File size in bytes
- file_date
-
Unix time when the file was uploaded
Official reference: This object represents one size of a photo or a file / sticker thumbnail.
pub type PhotoSize {
PhotoSize(
file_id: String,
file_unique_id: String,
width: Int,
height: Int,
file_size: Option(Int),
)
}
Constructors
-
PhotoSize( file_id: String, file_unique_id: String, width: Int, height: Int, file_size: Option(Int), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- width
-
Photo width
- height
-
Photo height
- file_size
-
Optional. File size in bytes
Official reference: This object contains information about a poll.
pub type Poll {
Poll(
id: String,
question: String,
question_entities: Option(List(MessageEntity)),
options: List(PollOption),
total_voter_count: Int,
is_closed: Bool,
is_anonymous: Bool,
type_: String,
allows_multiple_answers: Bool,
correct_option_id: Option(Int),
explanation: Option(String),
explanation_entities: Option(List(MessageEntity)),
open_period: Option(Int),
close_date: Option(Int),
)
}
Constructors
-
Poll( id: String, question: String, question_entities: Option(List(MessageEntity)), options: List(PollOption), total_voter_count: Int, is_closed: Bool, is_anonymous: Bool, type_: String, allows_multiple_answers: Bool, correct_option_id: Option(Int), explanation: Option(String), explanation_entities: Option(List(MessageEntity)), open_period: Option(Int), close_date: Option(Int), )
Arguments
- id
-
Unique poll identifier
- question
-
Poll question, 1-300 characters
- question_entities
-
Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
- options
-
List of poll options
- total_voter_count
-
Total number of users that voted in the poll
- is_closed
-
True, if the poll is closed
- is_anonymous
-
True, if the poll is anonymous
- type_
-
Poll type, currently can be “regular” or “quiz”
- allows_multiple_answers
-
True, if the poll allows multiple answers
- correct_option_id
-
Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
- explanation
-
Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
- explanation_entities
-
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
- open_period
-
Optional. Amount of time in seconds the poll will be active after creation
- close_date
-
Optional. Point in time (Unix timestamp) when the poll will be automatically closed
Official reference: This object represents an answer of a user in a non-anonymous poll.
pub type PollAnswer {
PollAnswer(
poll_id: String,
voter_chat: Option(Chat),
user: Option(User),
option_ids: List(Int),
)
}
Constructors
-
PollAnswer( poll_id: String, voter_chat: Option(Chat), user: Option(User), option_ids: List(Int), )
Arguments
- poll_id
-
Unique poll identifier
- voter_chat
-
Optional. The chat that changed the answer to the poll, if the voter is anonymous
- user
-
Optional. The user that changed the answer to the poll, if the voter isn’t anonymous
- option_ids
-
0-based identifiers of chosen answer options. May be empty if the vote was retracted.
Official reference: This object contains information about one answer option in a poll.
pub type PollOption {
PollOption(
text: String,
text_entities: Option(List(MessageEntity)),
voter_count: Int,
)
}
Constructors
-
PollOption( text: String, text_entities: Option(List(MessageEntity)), voter_count: Int, )
Arguments
- text
-
Option text, 1-100 characters
- text_entities
-
Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
- voter_count
-
Number of users that voted for this option
Official reference: This object contains information about an incoming pre-checkout query.
pub type PreCheckoutQuery {
PreCheckoutQuery(
id: String,
from: User,
currency: String,
total_amount: Int,
invoice_payload: String,
shipping_option_id: Option(String),
order_info: Option(OrderInfo),
)
}
Constructors
-
PreCheckoutQuery( id: String, from: User, currency: String, total_amount: Int, invoice_payload: String, shipping_option_id: Option(String), order_info: Option(OrderInfo), )
Arguments
- id
-
Unique query identifier
- from
-
User who sent the query
- currency
-
Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
- total_amount
-
Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
- invoice_payload
-
Bot-specified invoice payload
- shipping_option_id
-
Optional. Identifier of the shipping option chosen by the user
- order_info
-
Optional. Order information provided by the user
Official reference: Describes an inline message to be sent by a user of a Mini App.
pub type PreparedInlineMessage {
PreparedInlineMessage(id: String, expiration_date: Int)
}
Constructors
-
PreparedInlineMessage(id: String, expiration_date: Int)
Arguments
- id
-
Unique identifier of the prepared message
- expiration_date
-
Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used
Official reference: This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
pub type ProximityAlertTriggered {
ProximityAlertTriggered(
traveler: User,
watcher: User,
distance: Int,
)
}
Constructors
-
ProximityAlertTriggered( traveler: User, watcher: User, distance: Int, )
Arguments
- traveler
-
User that triggered the alert
- watcher
-
User that set the alert
- distance
-
The distance between the users
Official reference: Represents a reaction added to a message along with the number of times it was added.
pub type ReactionCount {
ReactionCount(type_: ReactionType, total_count: Int)
}
Constructors
-
ReactionCount(type_: ReactionType, total_count: Int)
Arguments
- type_
-
Type of the reaction
- total_count
-
Number of times the reaction was added
pub type ReactionType {
ReactionTypeEmojiReactionType(ReactionTypeEmoji)
ReactionTypeCustomEmojiReactionType(ReactionTypeCustomEmoji)
ReactionTypePaidReactionType(ReactionTypePaid)
}
Constructors
-
ReactionTypeEmojiReactionType(ReactionTypeEmoji)
-
ReactionTypeCustomEmojiReactionType(ReactionTypeCustomEmoji)
-
ReactionTypePaidReactionType(ReactionTypePaid)
Official reference: The reaction is based on a custom emoji.
pub type ReactionTypeCustomEmoji {
ReactionTypeCustomEmoji(type_: String, custom_emoji_id: String)
}
Constructors
-
ReactionTypeCustomEmoji(type_: String, custom_emoji_id: String)
Arguments
- type_
-
Type of the reaction, always “custom_emoji”
- custom_emoji_id
-
Custom emoji identifier
Official reference: The reaction is based on an emoji.
pub type ReactionTypeEmoji {
ReactionTypeEmoji(type_: String, emoji: String)
}
Constructors
-
ReactionTypeEmoji(type_: String, emoji: String)
Arguments
- type_
-
Type of the reaction, always “emoji”
- emoji
-
Reaction emoji. Currently, it can be one of “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”
Official reference: The reaction is paid.
pub type ReactionTypePaid {
ReactionTypePaid(type_: String)
}
Constructors
-
ReactionTypePaid(type_: String)
Arguments
- type_
-
Type of the reaction, always “paid”
Official reference: This object contains basic information about a refunded payment.
pub type RefundedPayment {
RefundedPayment(
currency: String,
total_amount: Int,
invoice_payload: String,
telegram_payment_charge_id: String,
provider_payment_charge_id: Option(String),
)
}
Constructors
-
RefundedPayment( currency: String, total_amount: Int, invoice_payload: String, telegram_payment_charge_id: String, provider_payment_charge_id: Option(String), )
Arguments
- currency
-
Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”
- total_amount
-
Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
- invoice_payload
-
Bot-specified invoice payload
- telegram_payment_charge_id
-
Telegram payment identifier
- provider_payment_charge_id
-
Optional. Provider payment identifier
Official reference: This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.
pub type ReplyKeyboardMarkup {
ReplyKeyboardMarkup(
keyboard: List(List(KeyboardButton)),
is_persistent: Option(Bool),
resize_keyboard: Option(Bool),
one_time_keyboard: Option(Bool),
input_field_placeholder: Option(String),
selective: Option(Bool),
)
}
Constructors
-
ReplyKeyboardMarkup( keyboard: List(List(KeyboardButton)), is_persistent: Option(Bool), resize_keyboard: Option(Bool), one_time_keyboard: Option(Bool), input_field_placeholder: Option(String), selective: Option(Bool), )
Arguments
- keyboard
-
Array of button rows, each represented by an Array of KeyboardButton objects
- is_persistent
-
Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
- resize_keyboard
-
Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app’s standard keyboard.
- one_time_keyboard
-
Optional. Requests clients to hide the keyboard as soon as it’s been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
- input_field_placeholder
-
Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
- selective
-
Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message.
Example: A user requests to change the bot’s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.
Official reference: Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.
pub type ReplyKeyboardRemove {
ReplyKeyboardRemove(
remove_keyboard: Bool,
selective: Option(Bool),
)
}
Constructors
-
ReplyKeyboardRemove( remove_keyboard: Bool, selective: Option(Bool), )
Arguments
- remove_keyboard
-
Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
- selective
-
Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message.
Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven’t voted yet.
Official reference: Describes reply parameters for the message that is being sent.
pub type ReplyParameters {
ReplyParameters(
message_id: Int,
chat_id: Option(IntOrString),
allow_sending_without_reply: Option(Bool),
quote: Option(String),
quote_parse_mode: Option(String),
quote_entities: Option(List(MessageEntity)),
quote_position: Option(Int),
)
}
Constructors
-
ReplyParameters( message_id: Int, chat_id: Option(IntOrString), allow_sending_without_reply: Option(Bool), quote: Option(String), quote_parse_mode: Option(String), quote_entities: Option(List(MessageEntity)), quote_position: Option(Int), )
Arguments
- message_id
-
Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified
- chat_id
-
Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account.
- allow_sending_without_reply
-
Optional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account.
- quote
-
Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn’t found in the original message.
- quote_parse_mode
-
Optional. Mode for parsing entities in the quote. See formatting options for more details.
- quote_entities
-
Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.
- quote_position
-
Optional. Position of the quote in the original message in UTF-16 code units
Official reference: Describes why a request was unsuccessful.
pub type ResponseParameters {
ResponseParameters(
migrate_to_chat_id: Option(Int),
retry_after: Option(Int),
)
}
Constructors
-
ResponseParameters( migrate_to_chat_id: Option(Int), retry_after: Option(Int), )
Arguments
- migrate_to_chat_id
-
Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
- retry_after
-
Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
pub type RevenueWithdrawalState {
RevenueWithdrawalStatePendingRevenueWithdrawalState(
RevenueWithdrawalStatePending,
)
RevenueWithdrawalStateSucceededRevenueWithdrawalState(
RevenueWithdrawalStateSucceeded,
)
RevenueWithdrawalStateFailedRevenueWithdrawalState(
RevenueWithdrawalStateFailed,
)
}
Constructors
-
RevenueWithdrawalStatePendingRevenueWithdrawalState( RevenueWithdrawalStatePending, )
-
RevenueWithdrawalStateSucceededRevenueWithdrawalState( RevenueWithdrawalStateSucceeded, )
-
RevenueWithdrawalStateFailedRevenueWithdrawalState( RevenueWithdrawalStateFailed, )
Official reference: The withdrawal failed and the transaction was refunded.
pub type RevenueWithdrawalStateFailed {
RevenueWithdrawalStateFailed(type_: String)
}
Constructors
-
RevenueWithdrawalStateFailed(type_: String)
Arguments
- type_
-
Type of the state, always “failed”
Official reference: The withdrawal is in progress.
pub type RevenueWithdrawalStatePending {
RevenueWithdrawalStatePending(type_: String)
}
Constructors
-
RevenueWithdrawalStatePending(type_: String)
Arguments
- type_
-
Type of the state, always “pending”
Official reference: The withdrawal succeeded.
pub type RevenueWithdrawalStateSucceeded {
RevenueWithdrawalStateSucceeded(
type_: String,
date: Int,
url: String,
)
}
Constructors
-
RevenueWithdrawalStateSucceeded( type_: String, date: Int, url: String, )
Arguments
- type_
-
Type of the state, always “succeeded”
- date
-
Date the withdrawal was completed in Unix time
- url
-
An HTTPS URL that can be used to see transaction details
pub type SendDiceParameters {
SendDiceParameters(
chat_id: IntOrString,
message_thread_id: Option(Int),
emoji: Option(String),
disable_notification: Option(Bool),
protect_content: Option(Bool),
reply_parameters: Option(ReplyKeyboardMarkup),
)
}
Constructors
-
SendDiceParameters( chat_id: IntOrString, message_thread_id: Option(Int), emoji: Option(String), disable_notification: Option(Bool), protect_content: Option(Bool), reply_parameters: Option(ReplyKeyboardMarkup), )
Arguments
- message_thread_id
-
Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
- emoji
-
Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
- disable_notification
-
Sends the message silently. Users will receive a notification with no sound.
- protect_content
-
Protects the contents of the sent message from forwarding
- reply_parameters
-
Description of the message to reply to
pub type SendMessageParameters {
SendMessageParameters(
business_connection_id: Option(String),
chat_id: IntOrString,
message_thread_id: Option(Int),
text: String,
parse_mode: Option(String),
entities: Option(List(MessageEntity)),
link_preview_options: Option(LinkPreviewOptions),
disable_notification: Option(Bool),
protect_content: Option(Bool),
reply_parameters: Option(ReplyParameters),
reply_markup: Option(SendMessageReplyMarkupParameters),
)
}
Constructors
-
SendMessageParameters( business_connection_id: Option(String), chat_id: IntOrString, message_thread_id: Option(Int), text: String, parse_mode: Option(String), entities: Option(List(MessageEntity)), link_preview_options: Option(LinkPreviewOptions), disable_notification: Option(Bool), protect_content: Option(Bool), reply_parameters: Option(ReplyParameters), reply_markup: Option(SendMessageReplyMarkupParameters), )
Parameters to send using the sendMessage method
Arguments
- business_connection_id
-
Unique identifier of the business connection on behalf of which the message will be sent
- chat_id
-
Unique identifier for the target chat or username of the target channel (in the format
@channelusername
) - message_thread_id
-
Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
- text
-
Text of the message to be sent, 1-4096 characters after entities parsing
- parse_mode
-
Mode for parsing entities in the message text. See formatting options for more details.
- entities
-
A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
- link_preview_options
-
Link preview generation options for the message
- disable_notification
-
Sends the message silently. Users will receive a notification with no sound.
- protect_content
-
Protects the contents of the sent message from forwarding and saving
- reply_parameters
-
Description of the message to reply to
- reply_markup
-
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
pub type SendMessageReplyMarkupParameters {
SendMessageReplyInlineKeyboardMarkupParameters(
InlineKeyboardMarkup,
)
SendMessageReplyReplyKeyboardMarkupParameters(
ReplyKeyboardMarkup,
)
SendMessageReplyRemoveKeyboardMarkupParameters(
ReplyKeyboardRemove,
)
SendMessageReplyForceReplyMarkupParameters(ForceReply)
}
Constructors
-
SendMessageReplyInlineKeyboardMarkupParameters( InlineKeyboardMarkup, )
-
SendMessageReplyReplyKeyboardMarkupParameters( ReplyKeyboardMarkup, )
-
SendMessageReplyRemoveKeyboardMarkupParameters( ReplyKeyboardRemove, )
-
SendMessageReplyForceReplyMarkupParameters(ForceReply)
Official reference: Describes an inline message sent by a Web App on behalf of a user.
pub type SentWebAppMessage {
SentWebAppMessage(inline_message_id: Option(String))
}
Constructors
-
SentWebAppMessage(inline_message_id: Option(String))
Arguments
- inline_message_id
-
Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message.
pub type SetChatMenuButtonParameters {
SetChatMenuButtonParameters(
chat_id: Option(Int),
menu_button: Option(MenuButton),
)
}
Constructors
-
SetChatMenuButtonParameters( chat_id: Option(Int), menu_button: Option(MenuButton), )
Arguments
- chat_id
-
Unique identifier for the target private chat. If not specified, default bot’s menu button will be changed
- menu_button
-
A JSON-serialized object for the bot’s new menu button. Defaults to MenuButtonDefault
https://core.telegram.org/bots/api#setwebhook
pub type SetWebhookParameters {
SetWebhookParameters(
url: String,
certificate: Option(File),
max_connections: Option(Int),
ip_address: Option(String),
allowed_updates: Option(List(String)),
drop_pending_updates: Option(Bool),
secret_token: Option(String),
)
}
Constructors
-
SetWebhookParameters( url: String, certificate: Option(File), max_connections: Option(Int), ip_address: Option(String), allowed_updates: Option(List(String)), drop_pending_updates: Option(Bool), secret_token: Option(String), )
Arguments
- url
-
HTTPS url to send updates to. Use an empty string to remove webhook integration
- certificate
-
Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
- max_connections
-
Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot’s server, and higher values to increase your bot’s throughput.
- ip_address
-
The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
- allowed_updates
-
A JSON-serialized list of the update types you want your bot to receive. For example, specify
["message", "edited_channel_post", "callback_query"]
to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.Please note that this parameter doesn’t affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.
- drop_pending_updates
-
Pass True to drop all pending updates
- secret_token
-
A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.
Official reference: This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
pub type SharedUser {
SharedUser(
user_id: Int,
first_name: Option(String),
last_name: Option(String),
username: Option(String),
photo: Option(List(PhotoSize)),
)
}
Constructors
-
SharedUser( user_id: Int, first_name: Option(String), last_name: Option(String), username: Option(String), photo: Option(List(PhotoSize)), )
Arguments
- user_id
-
Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.
- first_name
-
Optional. First name of the user, if the name was requested by the bot
- last_name
-
Optional. Last name of the user, if the name was requested by the bot
- username
-
Optional. Username of the user, if the username was requested by the bot
- photo
-
Optional. Available sizes of the chat photo, if the photo was requested by the bot
Official reference: This object represents a shipping address.
pub type ShippingAddress {
ShippingAddress(
country_code: String,
state: String,
city: String,
street_line1: String,
street_line2: String,
post_code: String,
)
}
Constructors
-
ShippingAddress( country_code: String, state: String, city: String, street_line1: String, street_line2: String, post_code: String, )
Arguments
- country_code
-
Two-letter ISO 3166-1 alpha-2 country code
- state
-
State, if applicable
- city
-
City
- street_line1
-
First line for the address
- street_line2
-
Second line for the address
- post_code
-
Address post code
Official reference: This object represents one shipping option.
pub type ShippingOption {
ShippingOption(
id: String,
title: String,
prices: List(LabeledPrice),
)
}
Constructors
-
ShippingOption( id: String, title: String, prices: List(LabeledPrice), )
Arguments
- id
-
Shipping option identifier
- title
-
Option title
- prices
-
List of price portions
Official reference: This object contains information about an incoming shipping query.
pub type ShippingQuery {
ShippingQuery(
id: String,
from: User,
invoice_payload: String,
shipping_address: ShippingAddress,
)
}
Constructors
-
ShippingQuery( id: String, from: User, invoice_payload: String, shipping_address: ShippingAddress, )
Arguments
- id
-
Unique query identifier
- from
-
User who sent the query
- invoice_payload
-
Bot-specified invoice payload
- shipping_address
-
User specified shipping address
Official reference: Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot’s balance. This is outside of Telegram’s control.
pub type StarTransaction {
StarTransaction(
id: String,
amount: Int,
nanostar_amount: Option(Int),
date: Int,
source: Option(TransactionPartner),
receiver: Option(TransactionPartner),
)
}
Constructors
-
StarTransaction( id: String, amount: Int, nanostar_amount: Option(Int), date: Int, source: Option(TransactionPartner), receiver: Option(TransactionPartner), )
Arguments
- id
-
Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.
- amount
-
Integer amount of Telegram Stars transferred by the transaction
- nanostar_amount
-
Optional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999
- date
-
Date the transaction was created in Unix time
- source
-
Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions
- receiver
-
Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions
Official reference: Contains a list of Telegram Star transactions.
pub type StarTransactions {
StarTransactions(transactions: List(StarTransaction))
}
Constructors
-
StarTransactions(transactions: List(StarTransaction))
Arguments
- transactions
-
The list of transactions
Official reference: This object represents a sticker.
pub type Sticker {
Sticker(
file_id: String,
file_unique_id: String,
type_: String,
width: Int,
height: Int,
is_animated: Bool,
is_video: Bool,
thumbnail: Option(PhotoSize),
emoji: Option(String),
set_name: Option(String),
premium_animation: Option(File),
mask_position: Option(MaskPosition),
custom_emoji_id: Option(String),
needs_repainting: Option(Bool),
file_size: Option(Int),
)
}
Constructors
-
Sticker( file_id: String, file_unique_id: String, type_: String, width: Int, height: Int, is_animated: Bool, is_video: Bool, thumbnail: Option(PhotoSize), emoji: Option(String), set_name: Option(String), premium_animation: Option(File), mask_position: Option(MaskPosition), custom_emoji_id: Option(String), needs_repainting: Option(Bool), file_size: Option(Int), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- type_
-
Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.
- width
-
Sticker width
- height
-
Sticker height
- is_animated
-
True, if the sticker is animated
- is_video
-
True, if the sticker is a video sticker
- thumbnail
-
Optional. Sticker thumbnail in the .WEBP or .JPG format
- emoji
-
Optional. Emoji associated with the sticker
- set_name
-
Optional. Name of the sticker set to which the sticker belongs
- premium_animation
-
Optional. For premium regular stickers, premium animation for the sticker
- mask_position
-
Optional. For mask stickers, the position where the mask should be placed
- custom_emoji_id
-
Optional. For custom emoji stickers, unique identifier of the custom emoji
- needs_repainting
-
Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places
- file_size
-
Optional. File size in bytes
Official reference: This object represents a sticker set.
pub type StickerSet {
StickerSet(
name: String,
title: String,
sticker_type: String,
stickers: List(Sticker),
thumbnail: Option(PhotoSize),
)
}
Constructors
-
StickerSet( name: String, title: String, sticker_type: String, stickers: List(Sticker), thumbnail: Option(PhotoSize), )
Arguments
- name
-
Sticker set name
- title
-
Sticker set title
- sticker_type
-
Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
- stickers
-
List of all set stickers
- thumbnail
-
Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
Official reference: This object represents a story.
pub type Story {
Story(chat: Chat, id: Int)
}
Constructors
-
Story(chat: Chat, id: Int)
Arguments
- chat
-
Chat that posted the story
- id
-
Unique identifier for the story in the chat
Official reference: This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram’s control.
pub type SuccessfulPayment {
SuccessfulPayment(
currency: String,
total_amount: Int,
invoice_payload: String,
subscription_expiration_date: Option(Int),
is_recurring: Option(Bool),
is_first_recurring: Option(Bool),
shipping_option_id: Option(String),
order_info: Option(OrderInfo),
telegram_payment_charge_id: String,
provider_payment_charge_id: String,
)
}
Constructors
-
SuccessfulPayment( currency: String, total_amount: Int, invoice_payload: String, subscription_expiration_date: Option(Int), is_recurring: Option(Bool), is_first_recurring: Option(Bool), shipping_option_id: Option(String), order_info: Option(OrderInfo), telegram_payment_charge_id: String, provider_payment_charge_id: String, )
Arguments
- currency
-
Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
- total_amount
-
Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
- invoice_payload
-
Bot-specified invoice payload
- subscription_expiration_date
-
Optional. Expiration date of the subscription, in Unix time; for recurring payments only
- is_recurring
-
Optional. True, if the payment is a recurring payment for a subscription
- is_first_recurring
-
Optional. True, if the payment is the first payment for a subscription
- shipping_option_id
-
Optional. Identifier of the shipping option chosen by the user
- order_info
-
Optional. Order information provided by the user
- telegram_payment_charge_id
-
Telegram payment identifier
- provider_payment_charge_id
-
Provider payment identifier
Official reference: This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
pub type SwitchInlineQueryChosenChat {
SwitchInlineQueryChosenChat(
query: Option(String),
allow_user_chats: Option(Bool),
allow_bot_chats: Option(Bool),
allow_group_chats: Option(Bool),
allow_channel_chats: Option(Bool),
)
}
Constructors
-
SwitchInlineQueryChosenChat( query: Option(String), allow_user_chats: Option(Bool), allow_bot_chats: Option(Bool), allow_group_chats: Option(Bool), allow_channel_chats: Option(Bool), )
Arguments
- query
-
Optional. The default inline query to be inserted in the input field. If left empty, only the bot’s username will be inserted
- allow_user_chats
-
Optional. True, if private chats with users can be chosen
- allow_bot_chats
-
Optional. True, if private chats with bots can be chosen
- allow_group_chats
-
Optional. True, if group and supergroup chats can be chosen
- allow_channel_chats
-
Optional. True, if channel chats can be chosen
Official reference: This object contains information about the quoted part of a message that is replied to by the given message.
pub type TextQuote {
TextQuote(
text: String,
entities: Option(List(MessageEntity)),
position: Int,
is_manual: Option(Bool),
)
}
Constructors
-
TextQuote( text: String, entities: Option(List(MessageEntity)), position: Int, is_manual: Option(Bool), )
Arguments
- text
-
Text of the quoted part of a message that is replied to by the given message
- entities
-
Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.
- position
-
Approximate quote position in the original message in UTF-16 code units as specified by the sender
- is_manual
-
Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.
pub type TransactionPartner {
TransactionPartnerUserTransactionPartner(
TransactionPartnerUser,
)
TransactionPartnerChatTransactionPartner(
TransactionPartnerChat,
)
TransactionPartnerAffiliateProgramTransactionPartner(
TransactionPartnerAffiliateProgram,
)
TransactionPartnerFragmentTransactionPartner(
TransactionPartnerFragment,
)
TransactionPartnerTelegramAdsTransactionPartner(
TransactionPartnerTelegramAds,
)
TransactionPartnerTelegramApiTransactionPartner(
TransactionPartnerTelegramApi,
)
TransactionPartnerOtherTransactionPartner(
TransactionPartnerOther,
)
}
Constructors
-
TransactionPartnerUserTransactionPartner(TransactionPartnerUser)
-
TransactionPartnerChatTransactionPartner(TransactionPartnerChat)
-
TransactionPartnerAffiliateProgramTransactionPartner( TransactionPartnerAffiliateProgram, )
-
TransactionPartnerFragmentTransactionPartner( TransactionPartnerFragment, )
-
TransactionPartnerTelegramAdsTransactionPartner( TransactionPartnerTelegramAds, )
-
TransactionPartnerTelegramApiTransactionPartner( TransactionPartnerTelegramApi, )
-
TransactionPartnerOtherTransactionPartner( TransactionPartnerOther, )
Official reference: Describes the affiliate program that issued the affiliate commission received via this transaction.
pub type TransactionPartnerAffiliateProgram {
TransactionPartnerAffiliateProgram(
type_: String,
sponsor_user: Option(User),
commission_per_mille: Int,
)
}
Constructors
-
TransactionPartnerAffiliateProgram( type_: String, sponsor_user: Option(User), commission_per_mille: Int, )
Arguments
- type_
-
Type of the transaction partner, always “affiliate_program”
- sponsor_user
-
Optional. Information about the bot that sponsored the affiliate program
- commission_per_mille
-
The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users
Official reference: Describes a transaction with a chat.
pub type TransactionPartnerChat {
TransactionPartnerChat(
type_: String,
chat: Chat,
gift: Option(Gift),
)
}
Constructors
-
TransactionPartnerChat( type_: String, chat: Chat, gift: Option(Gift), )
Arguments
- type_
-
Type of the transaction partner, always “chat”
- chat
-
Information about the chat
- gift
-
Optional. The gift sent to the chat by the bot
Official reference: Describes a withdrawal transaction with Fragment.
pub type TransactionPartnerFragment {
TransactionPartnerFragment(
type_: String,
withdrawal_state: Option(RevenueWithdrawalState),
)
}
Constructors
-
TransactionPartnerFragment( type_: String, withdrawal_state: Option(RevenueWithdrawalState), )
Arguments
- type_
-
Type of the transaction partner, always “fragment”
- withdrawal_state
-
Optional. State of the transaction if the transaction is outgoing
Official reference: Describes a transaction with an unknown source or recipient.
pub type TransactionPartnerOther {
TransactionPartnerOther(type_: String)
}
Constructors
-
TransactionPartnerOther(type_: String)
Arguments
- type_
-
Type of the transaction partner, always “other”
Official reference: Describes a withdrawal transaction to the Telegram Ads platform.
pub type TransactionPartnerTelegramAds {
TransactionPartnerTelegramAds(type_: String)
}
Constructors
-
TransactionPartnerTelegramAds(type_: String)
Arguments
- type_
-
Type of the transaction partner, always “telegram_ads”
Official reference: Describes a transaction with payment for paid broadcasting.
pub type TransactionPartnerTelegramApi {
TransactionPartnerTelegramApi(
type_: String,
request_count: Int,
)
}
Constructors
-
TransactionPartnerTelegramApi(type_: String, request_count: Int)
Arguments
- type_
-
Type of the transaction partner, always “telegram_api”
- request_count
-
The number of successful requests that exceeded regular limits and were therefore billed
Official reference: Describes a transaction with a user.
pub type TransactionPartnerUser {
TransactionPartnerUser(
type_: String,
user: User,
affiliate: Option(AffiliateInfo),
invoice_payload: Option(String),
subscription_period: Option(Int),
paid_media: Option(List(PaidMedia)),
paid_media_payload: Option(String),
gift: Option(Gift),
)
}
Constructors
-
TransactionPartnerUser( type_: String, user: User, affiliate: Option(AffiliateInfo), invoice_payload: Option(String), subscription_period: Option(Int), paid_media: Option(List(PaidMedia)), paid_media_payload: Option(String), gift: Option(Gift), )
Arguments
- type_
-
Type of the transaction partner, always “user”
- user
-
Information about the user
- affiliate
-
Optional. Information about the affiliate that received a commission via this transaction
- invoice_payload
-
Optional. Bot-specified invoice payload
- subscription_period
-
Optional. The duration of the paid subscription
- paid_media
-
Optional. Information about the paid media bought by the user
- paid_media_payload
-
Optional. Bot-specified paid media payload
- gift
-
Optional. The gift sent to the user by the bot
Official reference: This object represents an incoming update. At most one of the optional parameters can be present in any given update.
pub type Update {
Update(
update_id: Int,
message: Option(Message),
edited_message: Option(Message),
channel_post: Option(Message),
edited_channel_post: Option(Message),
business_connection: Option(BusinessConnection),
business_message: Option(Message),
edited_business_message: Option(Message),
deleted_business_messages: Option(BusinessMessagesDeleted),
message_reaction: Option(MessageReactionUpdated),
message_reaction_count: Option(MessageReactionCountUpdated),
inline_query: Option(InlineQuery),
chosen_inline_result: Option(ChosenInlineResult),
callback_query: Option(CallbackQuery),
shipping_query: Option(ShippingQuery),
pre_checkout_query: Option(PreCheckoutQuery),
purchased_paid_media: Option(PaidMediaPurchased),
poll: Option(Poll),
poll_answer: Option(PollAnswer),
my_chat_member: Option(ChatMemberUpdated),
chat_member: Option(ChatMemberUpdated),
chat_join_request: Option(ChatJoinRequest),
chat_boost: Option(ChatBoostUpdated),
removed_chat_boost: Option(ChatBoostRemoved),
)
}
Constructors
-
Update( update_id: Int, message: Option(Message), edited_message: Option(Message), channel_post: Option(Message), edited_channel_post: Option(Message), business_connection: Option(BusinessConnection), business_message: Option(Message), edited_business_message: Option(Message), deleted_business_messages: Option(BusinessMessagesDeleted), message_reaction: Option(MessageReactionUpdated), message_reaction_count: Option(MessageReactionCountUpdated), inline_query: Option(InlineQuery), chosen_inline_result: Option(ChosenInlineResult), callback_query: Option(CallbackQuery), shipping_query: Option(ShippingQuery), pre_checkout_query: Option(PreCheckoutQuery), purchased_paid_media: Option(PaidMediaPurchased), poll: Option(Poll), poll_answer: Option(PollAnswer), my_chat_member: Option(ChatMemberUpdated), chat_member: Option(ChatMemberUpdated), chat_join_request: Option(ChatJoinRequest), chat_boost: Option(ChatBoostUpdated), removed_chat_boost: Option(ChatBoostRemoved), )
Arguments
- update_id
-
The update’s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you’re using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
- message
-
Optional. New incoming message of any kind - text, photo, sticker, etc.
- edited_message
-
Optional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
- channel_post
-
Optional. New incoming channel post of any kind - text, photo, sticker, etc.
- edited_channel_post
-
Optional. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
- business_connection
-
Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
- business_message
-
Optional. New message from a connected business account
- edited_business_message
-
Optional. New version of a message from a connected business account
- deleted_business_messages
-
Optional. Messages were deleted from a connected business account
- message_reaction
-
Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify “message_reaction” in the list of allowed_updates to receive these updates. The update isn’t received for reactions set by bots.
- message_reaction_count
-
Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify “message_reaction_count” in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.
- inline_query
-
Optional. New incoming inline query
- chosen_inline_result
-
Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
- callback_query
-
Optional. New incoming callback query
- shipping_query
-
Optional. New incoming shipping query. Only for invoices with flexible price
- pre_checkout_query
-
Optional. New incoming pre-checkout query. Contains full information about checkout
- purchased_paid_media
-
Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
- poll
-
Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
- poll_answer
-
Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
- my_chat_member
-
Optional. The bot’s chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
- chat_member
-
Optional. A chat member’s status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
- chat_join_request
-
Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
- chat_boost
-
Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
- removed_chat_boost
-
Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.
Official reference: This object represents a Telegram user or bot.
pub type User {
User(
id: Int,
is_bot: Bool,
first_name: String,
last_name: Option(String),
username: Option(String),
language_code: Option(String),
is_premium: Option(Bool),
added_to_attachment_menu: Option(Bool),
can_join_groups: Option(Bool),
can_read_all_group_messages: Option(Bool),
supports_inline_queries: Option(Bool),
can_connect_to_business: Option(Bool),
has_main_web_app: Option(Bool),
)
}
Constructors
-
User( id: Int, is_bot: Bool, first_name: String, last_name: Option(String), username: Option(String), language_code: Option(String), is_premium: Option(Bool), added_to_attachment_menu: Option(Bool), can_join_groups: Option(Bool), can_read_all_group_messages: Option(Bool), supports_inline_queries: Option(Bool), can_connect_to_business: Option(Bool), has_main_web_app: Option(Bool), )
Arguments
- id
-
Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
- is_bot
-
True, if this user is a bot
- first_name
-
User’s or bot’s first name
- last_name
-
Optional. User’s or bot’s last name
- username
-
Optional. User’s or bot’s username
- language_code
-
Optional. IETF language tag of the user’s language
- is_premium
-
Optional. True, if this user is a Telegram Premium user
- added_to_attachment_menu
-
Optional. True, if this user added the bot to the attachment menu
- can_join_groups
-
Optional. True, if the bot can be invited to groups. Returned only in getMe.
- can_read_all_group_messages
-
Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
- supports_inline_queries
-
Optional. True, if the bot supports inline queries. Returned only in getMe.
- can_connect_to_business
-
Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.
- has_main_web_app
-
Optional. True, if the bot has a main Web App. Returned only in getMe.
Official reference: This object represents a list of boosts added to a chat by a user.
pub type UserChatBoosts {
UserChatBoosts(boosts: List(ChatBoost))
}
Constructors
-
UserChatBoosts(boosts: List(ChatBoost))
Arguments
- boosts
-
The list of boosts added to the chat by the user
Official reference: This object represent a user’s profile pictures.
pub type UserProfilePhotos {
UserProfilePhotos(
total_count: Int,
photos: List(List(PhotoSize)),
)
}
Constructors
-
UserProfilePhotos( total_count: Int, photos: List(List(PhotoSize)), )
Arguments
- total_count
-
Total number of profile pictures the target user has
- photos
-
Requested profile pictures (in up to 4 sizes each)
Official reference: This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
pub type UsersShared {
UsersShared(request_id: Int, users: List(SharedUser))
}
Constructors
-
UsersShared(request_id: Int, users: List(SharedUser))
Arguments
- request_id
-
Identifier of the request
- users
-
Information about users shared with the bot.
Official reference: This object represents a venue.
pub type Venue {
Venue(
location: Location,
title: String,
address: String,
foursquare_id: Option(String),
foursquare_type: Option(String),
google_place_id: Option(String),
google_place_type: Option(String),
)
}
Constructors
-
Venue( location: Location, title: String, address: String, foursquare_id: Option(String), foursquare_type: Option(String), google_place_id: Option(String), google_place_type: Option(String), )
Arguments
- location
-
Venue location. Can’t be a live location
- title
-
Name of the venue
- address
-
Address of the venue
- foursquare_id
-
Optional. Foursquare identifier of the venue
- foursquare_type
-
Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
- google_place_id
-
Optional. Google Places identifier of the venue
- google_place_type
-
Optional. Google Places type of the venue. (See supported types.)
Official reference: This object represents a video file.
pub type Video {
Video(
file_id: String,
file_unique_id: String,
width: Int,
height: Int,
duration: Int,
thumbnail: Option(PhotoSize),
cover: Option(List(PhotoSize)),
start_timestamp: Option(Int),
file_name: Option(String),
mime_type: Option(String),
file_size: Option(Int),
)
}
Constructors
-
Video( file_id: String, file_unique_id: String, width: Int, height: Int, duration: Int, thumbnail: Option(PhotoSize), cover: Option(List(PhotoSize)), start_timestamp: Option(Int), file_name: Option(String), mime_type: Option(String), file_size: Option(Int), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- width
-
Video width as defined by the sender
- height
-
Video height as defined by the sender
- duration
-
Duration of the video in seconds as defined by the sender
- thumbnail
-
Optional. Video thumbnail
- cover
-
Optional. Available sizes of the cover of the video in the message
- start_timestamp
-
Optional. Timestamp in seconds from which the video will play in the message
- file_name
-
Optional. Original filename as defined by the sender
- mime_type
-
Optional. MIME type of the file as defined by the sender
- file_size
-
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
Official reference: This object represents a service message about a video chat ended in the chat.
pub type VideoChatEnded {
VideoChatEnded(duration: Int)
}
Constructors
-
VideoChatEnded(duration: Int)
Arguments
- duration
-
Video chat duration in seconds
Official reference: This object represents a service message about new members invited to a video chat.
pub type VideoChatParticipantsInvited {
VideoChatParticipantsInvited(users: List(User))
}
Constructors
-
VideoChatParticipantsInvited(users: List(User))
Arguments
- users
-
New members that were invited to the video chat
Official reference: This object represents a service message about a video chat scheduled in the chat.
pub type VideoChatScheduled {
VideoChatScheduled(start_date: Int)
}
Constructors
-
VideoChatScheduled(start_date: Int)
Arguments
- start_date
-
Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator
pub type VideoChatStarted {
VideoChatStarted
}
Constructors
-
VideoChatStarted
Official reference: This object represents a video message (available in Telegram apps as of v.4.0).
pub type VideoNote {
VideoNote(
file_id: String,
file_unique_id: String,
length: Int,
duration: Int,
thumbnail: Option(PhotoSize),
file_size: Option(Int),
)
}
Constructors
-
VideoNote( file_id: String, file_unique_id: String, length: Int, duration: Int, thumbnail: Option(PhotoSize), file_size: Option(Int), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- length
-
Video width and height (diameter of the video message) as defined by the sender
- duration
-
Duration of the video in seconds as defined by the sender
- thumbnail
-
Optional. Video thumbnail
- file_size
-
Optional. File size in bytes
Official reference: This object represents a voice note.
pub type Voice {
Voice(
file_id: String,
file_unique_id: String,
duration: Int,
mime_type: Option(String),
file_size: Option(Int),
)
}
Constructors
-
Voice( file_id: String, file_unique_id: String, duration: Int, mime_type: Option(String), file_size: Option(Int), )
Arguments
- file_id
-
Identifier for this file, which can be used to download or reuse the file
- file_unique_id
-
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- duration
-
Duration of the audio in seconds as defined by the sender
- mime_type
-
Optional. MIME type of the file as defined by the sender
- file_size
-
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
Official reference: Describes data sent from a Web App to the bot.
pub type WebAppData {
WebAppData(data: String, button_text: String)
}
Constructors
-
WebAppData(data: String, button_text: String)
Arguments
- data
-
The data. Be aware that a bad client can send arbitrary data in this field.
- button_text
-
Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.
Official reference: Describes a Web App.
pub type WebAppInfo {
WebAppInfo(url: String)
}
Constructors
-
WebAppInfo(url: String)
Arguments
- url
-
An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
Official reference: Describes the current status of a webhook.
pub type WebhookInfo {
WebhookInfo(
url: String,
has_custom_certificate: Bool,
pending_update_count: Int,
ip_address: Option(String),
last_error_date: Option(Int),
last_error_message: Option(String),
last_synchronization_error_date: Option(Int),
max_connections: Option(Int),
allowed_updates: Option(List(String)),
)
}
Constructors
-
WebhookInfo( url: String, has_custom_certificate: Bool, pending_update_count: Int, ip_address: Option(String), last_error_date: Option(Int), last_error_message: Option(String), last_synchronization_error_date: Option(Int), max_connections: Option(Int), allowed_updates: Option(List(String)), )
Arguments
- url
-
Webhook URL, may be empty if webhook is not set up
- has_custom_certificate
-
True, if a custom certificate was provided for webhook certificate checks
- pending_update_count
-
Number of updates awaiting delivery
- ip_address
-
Optional. Currently used webhook IP address
- last_error_date
-
Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
- last_error_message
-
Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
- last_synchronization_error_date
-
Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
- max_connections
-
Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
- allowed_updates
-
Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
Official reference: This object 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 sent by the method requestWriteAccess.
pub type WriteAccessAllowed {
WriteAccessAllowed(
from_request: Option(Bool),
web_app_name: Option(String),
from_attachment_menu: Option(Bool),
)
}
Constructors
-
WriteAccessAllowed( from_request: Option(Bool), web_app_name: Option(String), from_attachment_menu: Option(Bool), )
Arguments
- from_request
-
Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess
- web_app_name
-
Optional. Name of the Web App, if the access was granted when the Web App was launched from a link
- from_attachment_menu
-
Optional. True, if the access was granted when the bot was added to the attachment or side menu
Functions
pub fn affiliate_info_decoder() -> Decoder(AffiliateInfo)
pub fn animation_decoder() -> Decoder(Animation)
pub fn audio_decoder() -> Decoder(Audio)
pub fn background_fill_decoder() -> Decoder(BackgroundFill)
pub fn background_fill_freeform_gradient_decoder() -> Decoder(
BackgroundFillFreeformGradient,
)
pub fn background_fill_gradient_decoder() -> Decoder(
BackgroundFillGradient,
)
pub fn background_fill_solid_decoder() -> Decoder(
BackgroundFillSolid,
)
pub fn background_type_chat_theme_decoder() -> Decoder(
BackgroundTypeChatTheme,
)
pub fn background_type_decoder() -> Decoder(BackgroundType)
pub fn background_type_fill_decoder() -> Decoder(
BackgroundTypeFill,
)
pub fn background_type_pattern_decoder() -> Decoder(
BackgroundTypePattern,
)
pub fn background_type_wallpaper_decoder() -> Decoder(
BackgroundTypeWallpaper,
)
pub fn birthdate_decoder() -> Decoder(Birthdate)
pub fn bot_command_decoder() -> Decoder(BotCommand)
pub fn bot_command_scope_all_chat_administrators_decoder() -> Decoder(
BotCommandScopeAllChatAdministrators,
)
pub fn bot_command_scope_all_group_chats_decoder() -> Decoder(
BotCommandScopeAllGroupChats,
)
pub fn bot_command_scope_all_private_chats_decoder() -> Decoder(
BotCommandScopeAllPrivateChats,
)
pub fn bot_command_scope_chat_administrators_decoder() -> Decoder(
BotCommandScopeChatAdministrators,
)
pub fn bot_command_scope_chat_decoder() -> Decoder(
BotCommandScopeChat,
)
pub fn bot_command_scope_chat_member_decoder() -> Decoder(
BotCommandScopeChatMember,
)
pub fn bot_command_scope_decoder() -> Decoder(BotCommandScope)
pub fn bot_command_scope_default_decoder() -> Decoder(
BotCommandScopeDefault,
)
pub fn bot_command_scope_to_json(scope: BotCommandScope) -> Json
pub fn bot_commands_from(
commands: List(#(String, String)),
) -> List(BotCommand)
pub fn bot_description_decoder() -> Decoder(BotDescription)
pub fn bot_name_decoder() -> Decoder(BotName)
pub fn bot_short_description_decoder() -> Decoder(
BotShortDescription,
)
pub fn business_connection_decoder() -> Decoder(
BusinessConnection,
)
pub fn business_intro_decoder() -> Decoder(BusinessIntro)
pub fn business_location_decoder() -> Decoder(BusinessLocation)
pub fn business_messages_deleted_decoder() -> Decoder(
BusinessMessagesDeleted,
)
pub fn business_opening_hours_decoder() -> Decoder(
BusinessOpeningHours,
)
pub fn business_opening_hours_interval_decoder() -> Decoder(
BusinessOpeningHoursInterval,
)
pub fn callback_game_decoder() -> Decoder(CallbackGame)
pub fn callback_query_decoder() -> Decoder(CallbackQuery)
pub fn chat_administrator_rights_decoder() -> Decoder(
ChatAdministratorRights,
)
pub fn chat_background_decoder() -> Decoder(ChatBackground)
pub fn chat_boost_added_decoder() -> Decoder(ChatBoostAdded)
pub fn chat_boost_decoder() -> Decoder(ChatBoost)
pub fn chat_boost_removed_decoder() -> Decoder(ChatBoostRemoved)
pub fn chat_boost_source_decoder() -> Decoder(ChatBoostSource)
pub fn chat_boost_source_gift_code_decoder() -> Decoder(
ChatBoostSourceGiftCode,
)
pub fn chat_boost_source_giveaway_decoder() -> Decoder(
ChatBoostSourceGiveaway,
)
pub fn chat_boost_source_premium_decoder() -> Decoder(
ChatBoostSourcePremium,
)
pub fn chat_boost_updated_decoder() -> Decoder(ChatBoostUpdated)
pub fn chat_decoder() -> Decoder(Chat)
pub fn chat_full_info_decoder() -> Decoder(ChatFullInfo)
pub fn chat_invite_link_decoder() -> Decoder(ChatInviteLink)
pub fn chat_join_request_decoder() -> Decoder(ChatJoinRequest)
pub fn chat_location_decoder() -> Decoder(ChatLocation)
pub fn chat_member_administrator_decoder() -> Decoder(
ChatMemberAdministrator,
)
pub fn chat_member_banned_decoder() -> Decoder(ChatMemberBanned)
pub fn chat_member_decoder() -> Decoder(ChatMember)
pub fn chat_member_left_decoder() -> Decoder(ChatMemberLeft)
pub fn chat_member_member_decoder() -> Decoder(ChatMemberMember)
pub fn chat_member_owner_decoder() -> Decoder(ChatMemberOwner)
pub fn chat_member_restricted_decoder() -> Decoder(
ChatMemberRestricted,
)
pub fn chat_member_updated_decoder() -> Decoder(ChatMemberUpdated)
pub fn chat_permissions_decoder() -> Decoder(ChatPermissions)
pub fn chat_photo_decoder() -> Decoder(ChatPhoto)
pub fn chat_shared_decoder() -> Decoder(ChatShared)
pub fn chosen_inline_result_decoder() -> Decoder(
ChosenInlineResult,
)
pub fn contact_decoder() -> Decoder(Contact)
pub fn copy_text_button_decoder() -> Decoder(CopyTextButton)
pub fn default_bot_command_parameters() -> BotCommandParameters
pub fn dice_decoder() -> Decoder(Dice)
pub fn document_decoder() -> Decoder(Document)
pub fn encode_affiliate_info(
affiliate_info: AffiliateInfo,
) -> Json
pub fn encode_animation(animation: Animation) -> Json
pub fn encode_answer_callback_query_parameters(
params: AnswerCallbackQueryParameters,
) -> Json
pub fn encode_audio(audio: Audio) -> Json
pub fn encode_background_fill(value: BackgroundFill) -> Json
pub fn encode_background_fill_freeform_gradient(
background_fill_freeform_gradient: BackgroundFillFreeformGradient,
) -> Json
pub fn encode_background_fill_gradient(
background_fill_gradient: BackgroundFillGradient,
) -> Json
pub fn encode_background_fill_solid(
background_fill_solid: BackgroundFillSolid,
) -> Json
pub fn encode_background_type(value: BackgroundType) -> Json
pub fn encode_background_type_chat_theme(
background_type_chat_theme: BackgroundTypeChatTheme,
) -> Json
pub fn encode_background_type_fill(
background_type_fill: BackgroundTypeFill,
) -> Json
pub fn encode_background_type_pattern(
background_type_pattern: BackgroundTypePattern,
) -> Json
pub fn encode_background_type_wallpaper(
background_type_wallpaper: BackgroundTypeWallpaper,
) -> Json
pub fn encode_birthdate(birthdate: Birthdate) -> Json
pub fn encode_bot_command(bot_command: BotCommand) -> Json
pub fn encode_bot_command_parameters(
params: BotCommandParameters,
) -> List(#(String, Json))
pub fn encode_bot_command_scope(value: BotCommandScope) -> Json
pub fn encode_bot_command_scope_all_chat_administrators(
bot_command_scope_all_chat_administrators: BotCommandScopeAllChatAdministrators,
) -> Json
pub fn encode_bot_command_scope_all_group_chats(
bot_command_scope_all_group_chats: BotCommandScopeAllGroupChats,
) -> Json
pub fn encode_bot_command_scope_all_private_chats(
bot_command_scope_all_private_chats: BotCommandScopeAllPrivateChats,
) -> Json
pub fn encode_bot_command_scope_chat(
bot_command_scope_chat: BotCommandScopeChat,
) -> Json
pub fn encode_bot_command_scope_chat_administrators(
bot_command_scope_chat_administrators: BotCommandScopeChatAdministrators,
) -> Json
pub fn encode_bot_command_scope_chat_member(
bot_command_scope_chat_member: BotCommandScopeChatMember,
) -> Json
pub fn encode_bot_command_scope_default(
bot_command_scope_default: BotCommandScopeDefault,
) -> Json
pub fn encode_bot_description(
bot_description: BotDescription,
) -> Json
pub fn encode_bot_name(bot_name: BotName) -> Json
pub fn encode_bot_short_description(
bot_short_description: BotShortDescription,
) -> Json
pub fn encode_business_connection(
business_connection: BusinessConnection,
) -> Json
pub fn encode_business_intro(
business_intro: BusinessIntro,
) -> Json
pub fn encode_business_location(
business_location: BusinessLocation,
) -> Json
pub fn encode_business_messages_deleted(
business_messages_deleted: BusinessMessagesDeleted,
) -> Json
pub fn encode_business_opening_hours(
business_opening_hours: BusinessOpeningHours,
) -> Json
pub fn encode_business_opening_hours_interval(
business_opening_hours_interval: BusinessOpeningHoursInterval,
) -> Json
pub fn encode_callback_game(callback_game: CallbackGame) -> Json
pub fn encode_callback_query(
callback_query: CallbackQuery,
) -> Json
pub fn encode_chat(chat: Chat) -> Json
pub fn encode_chat_administrator_rights(
chat_administrator_rights: ChatAdministratorRights,
) -> Json
pub fn encode_chat_background(
chat_background: ChatBackground,
) -> Json
pub fn encode_chat_boost(chat_boost: ChatBoost) -> Json
pub fn encode_chat_boost_added(
chat_boost_added: ChatBoostAdded,
) -> Json
pub fn encode_chat_boost_removed(
chat_boost_removed: ChatBoostRemoved,
) -> Json
pub fn encode_chat_boost_source(value: ChatBoostSource) -> Json
pub fn encode_chat_boost_source_gift_code(
chat_boost_source_gift_code: ChatBoostSourceGiftCode,
) -> Json
pub fn encode_chat_boost_source_giveaway(
chat_boost_source_giveaway: ChatBoostSourceGiveaway,
) -> Json
pub fn encode_chat_boost_source_premium(
chat_boost_source_premium: ChatBoostSourcePremium,
) -> Json
pub fn encode_chat_boost_updated(
chat_boost_updated: ChatBoostUpdated,
) -> Json
pub fn encode_chat_full_info(
chat_full_info: ChatFullInfo,
) -> Json
pub fn encode_chat_invite_link(
chat_invite_link: ChatInviteLink,
) -> Json
pub fn encode_chat_join_request(
chat_join_request: ChatJoinRequest,
) -> Json
pub fn encode_chat_location(chat_location: ChatLocation) -> Json
pub fn encode_chat_member(value: ChatMember) -> Json
pub fn encode_chat_member_administrator(
chat_member_administrator: ChatMemberAdministrator,
) -> Json
pub fn encode_chat_member_banned(
chat_member_banned: ChatMemberBanned,
) -> Json
pub fn encode_chat_member_left(
chat_member_left: ChatMemberLeft,
) -> Json
pub fn encode_chat_member_member(
chat_member_member: ChatMemberMember,
) -> Json
pub fn encode_chat_member_owner(
chat_member_owner: ChatMemberOwner,
) -> Json
pub fn encode_chat_member_restricted(
chat_member_restricted: ChatMemberRestricted,
) -> Json
pub fn encode_chat_member_updated(
chat_member_updated: ChatMemberUpdated,
) -> Json
pub fn encode_chat_permissions(
chat_permissions: ChatPermissions,
) -> Json
pub fn encode_chat_photo(chat_photo: ChatPhoto) -> Json
pub fn encode_chat_shared(chat_shared: ChatShared) -> Json
pub fn encode_chosen_inline_result(
chosen_inline_result: ChosenInlineResult,
) -> Json
pub fn encode_contact(contact: Contact) -> Json
pub fn encode_copy_text_button(
copy_text_button: CopyTextButton,
) -> Json
pub fn encode_dice(dice: Dice) -> Json
pub fn encode_document(document: Document) -> Json
pub fn encode_edit_message_text_parameters(
params: EditMessageTextParameters,
) -> Json
pub fn encode_encrypted_credentials(
encrypted_credentials: EncryptedCredentials,
) -> Json
pub fn encode_encrypted_passport_element(
encrypted_passport_element: EncryptedPassportElement,
) -> Json
pub fn encode_external_reply_info(
external_reply_info: ExternalReplyInfo,
) -> Json
pub fn encode_file(file: File) -> Json
pub fn encode_file_or_string(value: FileOrString) -> Json
pub fn encode_force_reply(force_reply: ForceReply) -> Json
pub fn encode_forum_topic(forum_topic: ForumTopic) -> Json
pub fn encode_forum_topic_closed(
forum_topic_closed: ForumTopicClosed,
) -> Json
pub fn encode_forum_topic_created(
forum_topic_created: ForumTopicCreated,
) -> Json
pub fn encode_forum_topic_edited(
forum_topic_edited: ForumTopicEdited,
) -> Json
pub fn encode_forum_topic_reopened(
forum_topic_reopened: ForumTopicReopened,
) -> Json
pub fn encode_forward_message_parameters(
params: ForwardMessageParameters,
) -> Json
pub fn encode_game(game: Game) -> Json
pub fn encode_game_high_score(
game_high_score: GameHighScore,
) -> Json
pub fn encode_general_forum_topic_hidden(
general_forum_topic_hidden: GeneralForumTopicHidden,
) -> Json
pub fn encode_general_forum_topic_unhidden(
general_forum_topic_unhidden: GeneralForumTopicUnhidden,
) -> Json
pub fn encode_gift(gift: Gift) -> Json
pub fn encode_gifts(gifts: Gifts) -> Json
pub fn encode_giveaway(giveaway: Giveaway) -> Json
pub fn encode_giveaway_completed(
giveaway_completed: GiveawayCompleted,
) -> Json
pub fn encode_giveaway_created(
giveaway_created: GiveawayCreated,
) -> Json
pub fn encode_giveaway_winners(
giveaway_winners: GiveawayWinners,
) -> Json
pub fn encode_inaccessible_message(
inaccessible_message: InaccessibleMessage,
) -> Json
pub fn encode_inline_keyboard_button(
inline_keyboard_button: InlineKeyboardButton,
) -> Json
pub fn encode_inline_keyboard_markup(
inline_keyboard_markup: InlineKeyboardMarkup,
) -> Json
pub fn encode_inline_query(inline_query: InlineQuery) -> Json
pub fn encode_inline_query_result(
value: InlineQueryResult,
) -> Json
pub fn encode_inline_query_result_article(
inline_query_result_article: InlineQueryResultArticle,
) -> Json
pub fn encode_inline_query_result_audio(
inline_query_result_audio: InlineQueryResultAudio,
) -> Json
pub fn encode_inline_query_result_cached_audio(
inline_query_result_cached_audio: InlineQueryResultCachedAudio,
) -> Json
pub fn encode_inline_query_result_cached_document(
inline_query_result_cached_document: InlineQueryResultCachedDocument,
) -> Json
pub fn encode_inline_query_result_cached_gif(
inline_query_result_cached_gif: InlineQueryResultCachedGif,
) -> Json
pub fn encode_inline_query_result_cached_mpeg4_gif(
inline_query_result_cached_mpeg4_gif: InlineQueryResultCachedMpeg4Gif,
) -> Json
pub fn encode_inline_query_result_cached_photo(
inline_query_result_cached_photo: InlineQueryResultCachedPhoto,
) -> Json
pub fn encode_inline_query_result_cached_sticker(
inline_query_result_cached_sticker: InlineQueryResultCachedSticker,
) -> Json
pub fn encode_inline_query_result_cached_video(
inline_query_result_cached_video: InlineQueryResultCachedVideo,
) -> Json
pub fn encode_inline_query_result_cached_voice(
inline_query_result_cached_voice: InlineQueryResultCachedVoice,
) -> Json
pub fn encode_inline_query_result_contact(
inline_query_result_contact: InlineQueryResultContact,
) -> Json
pub fn encode_inline_query_result_document(
inline_query_result_document: InlineQueryResultDocument,
) -> Json
pub fn encode_inline_query_result_game(
inline_query_result_game: InlineQueryResultGame,
) -> Json
pub fn encode_inline_query_result_gif(
inline_query_result_gif: InlineQueryResultGif,
) -> Json
pub fn encode_inline_query_result_location(
inline_query_result_location: InlineQueryResultLocation,
) -> Json
pub fn encode_inline_query_result_mpeg4_gif(
inline_query_result_mpeg4_gif: InlineQueryResultMpeg4Gif,
) -> Json
pub fn encode_inline_query_result_photo(
inline_query_result_photo: InlineQueryResultPhoto,
) -> Json
pub fn encode_inline_query_result_venue(
inline_query_result_venue: InlineQueryResultVenue,
) -> Json
pub fn encode_inline_query_result_video(
inline_query_result_video: InlineQueryResultVideo,
) -> Json
pub fn encode_inline_query_result_voice(
inline_query_result_voice: InlineQueryResultVoice,
) -> Json
pub fn encode_inline_query_results_button(
inline_query_results_button: InlineQueryResultsButton,
) -> Json
pub fn encode_input_contact_message_content(
input_contact_message_content: InputContactMessageContent,
) -> Json
pub fn encode_input_invoice_message_content(
input_invoice_message_content: InputInvoiceMessageContent,
) -> Json
pub fn encode_input_location_message_content(
input_location_message_content: InputLocationMessageContent,
) -> Json
pub fn encode_input_media(value: InputMedia) -> Json
pub fn encode_input_media_animation(
input_media_animation: InputMediaAnimation,
) -> Json
pub fn encode_input_media_audio(
input_media_audio: InputMediaAudio,
) -> Json
pub fn encode_input_media_document(
input_media_document: InputMediaDocument,
) -> Json
pub fn encode_input_media_photo(
input_media_photo: InputMediaPhoto,
) -> Json
pub fn encode_input_media_video(
input_media_video: InputMediaVideo,
) -> Json
pub fn encode_input_message_content(
value: InputMessageContent,
) -> Json
pub fn encode_input_paid_media(value: InputPaidMedia) -> Json
pub fn encode_input_paid_media_photo(
input_paid_media_photo: InputPaidMediaPhoto,
) -> Json
pub fn encode_input_paid_media_video(
input_paid_media_video: InputPaidMediaVideo,
) -> Json
pub fn encode_input_poll_option(
input_poll_option: InputPollOption,
) -> Json
pub fn encode_input_sticker(input_sticker: InputSticker) -> Json
pub fn encode_input_text_message_content(
input_text_message_content: InputTextMessageContent,
) -> Json
pub fn encode_input_venue_message_content(
input_venue_message_content: InputVenueMessageContent,
) -> Json
pub fn encode_int_or_string(value: IntOrString) -> Json
pub fn encode_invoice(invoice: Invoice) -> Json
pub fn encode_keyboard_button(
keyboard_button: KeyboardButton,
) -> Json
pub fn encode_keyboard_button_poll_type(
keyboard_button_poll_type: KeyboardButtonPollType,
) -> Json
pub fn encode_keyboard_button_request_chat(
keyboard_button_request_chat: KeyboardButtonRequestChat,
) -> Json
pub fn encode_keyboard_button_request_users(
keyboard_button_request_users: KeyboardButtonRequestUsers,
) -> Json
pub fn encode_labeled_price(labeled_price: LabeledPrice) -> Json
pub fn encode_link_preview_options(
link_preview_options: LinkPreviewOptions,
) -> Json
pub fn encode_location(location: Location) -> Json
pub fn encode_login_url(login_url: LoginUrl) -> Json
pub fn encode_mask_position(mask_position: MaskPosition) -> Json
pub fn encode_maybe_inaccessible_message(
value: MaybeInaccessibleMessage,
) -> Json
pub fn encode_menu_button(value: MenuButton) -> Json
pub fn encode_menu_button_commands(
menu_button_commands: MenuButtonCommands,
) -> Json
pub fn encode_menu_button_default(
menu_button_default: MenuButtonDefault,
) -> Json
pub fn encode_menu_button_web_app(
menu_button_web_app: MenuButtonWebApp,
) -> Json
pub fn encode_message(message: Message) -> Json
pub fn encode_message_auto_delete_timer_changed(
message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged,
) -> Json
pub fn encode_message_entity(
message_entity: MessageEntity,
) -> Json
pub fn encode_message_id(message_id: MessageId) -> Json
pub fn encode_message_origin(value: MessageOrigin) -> Json
pub fn encode_message_origin_channel(
message_origin_channel: MessageOriginChannel,
) -> Json
pub fn encode_message_origin_chat(
message_origin_chat: MessageOriginChat,
) -> Json
pub fn encode_message_origin_hidden_user(
message_origin_hidden_user: MessageOriginHiddenUser,
) -> Json
pub fn encode_message_origin_user(
message_origin_user: MessageOriginUser,
) -> Json
pub fn encode_message_reaction_count_updated(
message_reaction_count_updated: MessageReactionCountUpdated,
) -> Json
pub fn encode_message_reaction_updated(
message_reaction_updated: MessageReactionUpdated,
) -> Json
pub fn encode_order_info(order_info: OrderInfo) -> Json
pub fn encode_paid_media(value: PaidMedia) -> Json
pub fn encode_paid_media_info(
paid_media_info: PaidMediaInfo,
) -> Json
pub fn encode_paid_media_photo(
paid_media_photo: PaidMediaPhoto,
) -> Json
pub fn encode_paid_media_preview(
paid_media_preview: PaidMediaPreview,
) -> Json
pub fn encode_paid_media_purchased(
paid_media_purchased: PaidMediaPurchased,
) -> Json
pub fn encode_paid_media_video(
paid_media_video: PaidMediaVideo,
) -> Json
pub fn encode_passport_data(passport_data: PassportData) -> Json
pub fn encode_passport_element_error(
value: PassportElementError,
) -> Json
pub fn encode_passport_element_error_data_field(
passport_element_error_data_field: PassportElementErrorDataField,
) -> Json
pub fn encode_passport_element_error_file(
passport_element_error_file: PassportElementErrorFile,
) -> Json
pub fn encode_passport_element_error_files(
passport_element_error_files: PassportElementErrorFiles,
) -> Json
pub fn encode_passport_element_error_front_side(
passport_element_error_front_side: PassportElementErrorFrontSide,
) -> Json
pub fn encode_passport_element_error_reverse_side(
passport_element_error_reverse_side: PassportElementErrorReverseSide,
) -> Json
pub fn encode_passport_element_error_selfie(
passport_element_error_selfie: PassportElementErrorSelfie,
) -> Json
pub fn encode_passport_element_error_translation_file(
passport_element_error_translation_file: PassportElementErrorTranslationFile,
) -> Json
pub fn encode_passport_element_error_translation_files(
passport_element_error_translation_files: PassportElementErrorTranslationFiles,
) -> Json
pub fn encode_passport_element_error_unspecified(
passport_element_error_unspecified: PassportElementErrorUnspecified,
) -> Json
pub fn encode_passport_file(passport_file: PassportFile) -> Json
pub fn encode_photo_size(photo_size: PhotoSize) -> Json
pub fn encode_poll(poll: Poll) -> Json
pub fn encode_poll_answer(poll_answer: PollAnswer) -> Json
pub fn encode_poll_option(poll_option: PollOption) -> Json
pub fn encode_pre_checkout_query(
pre_checkout_query: PreCheckoutQuery,
) -> Json
pub fn encode_prepared_inline_message(
prepared_inline_message: PreparedInlineMessage,
) -> Json
pub fn encode_proximity_alert_triggered(
proximity_alert_triggered: ProximityAlertTriggered,
) -> Json
pub fn encode_reaction_count(
reaction_count: ReactionCount,
) -> Json
pub fn encode_reaction_type(value: ReactionType) -> Json
pub fn encode_reaction_type_custom_emoji(
reaction_type_custom_emoji: ReactionTypeCustomEmoji,
) -> Json
pub fn encode_reaction_type_emoji(
reaction_type_emoji: ReactionTypeEmoji,
) -> Json
pub fn encode_reaction_type_paid(
reaction_type_paid: ReactionTypePaid,
) -> Json
pub fn encode_refunded_payment(
refunded_payment: RefundedPayment,
) -> Json
pub fn encode_reply_keyboard_markup(
reply_keyboard_markup: ReplyKeyboardMarkup,
) -> Json
pub fn encode_reply_keyboard_remove(
reply_keyboard_remove: ReplyKeyboardRemove,
) -> Json
pub fn encode_reply_parameters(
reply_parameters: ReplyParameters,
) -> Json
pub fn encode_response_parameters(
response_parameters: ResponseParameters,
) -> Json
pub fn encode_revenue_withdrawal_state(
value: RevenueWithdrawalState,
) -> Json
pub fn encode_revenue_withdrawal_state_failed(
revenue_withdrawal_state_failed: RevenueWithdrawalStateFailed,
) -> Json
pub fn encode_revenue_withdrawal_state_pending(
revenue_withdrawal_state_pending: RevenueWithdrawalStatePending,
) -> Json
pub fn encode_revenue_withdrawal_state_succeeded(
revenue_withdrawal_state_succeeded: RevenueWithdrawalStateSucceeded,
) -> Json
pub fn encode_send_dice_parameters(
params: SendDiceParameters,
) -> Json
pub fn encode_send_message_parameters(
send_message_parameters: SendMessageParameters,
) -> Json
pub fn encode_send_message_reply_markup_parameters(
params: SendMessageReplyMarkupParameters,
) -> Json
pub fn encode_sent_web_app_message(
sent_web_app_message: SentWebAppMessage,
) -> Json
pub fn encode_set_chat_menu_button_parameters(
params: SetChatMenuButtonParameters,
) -> Json
pub fn encode_set_webhook_parameters(
params: SetWebhookParameters,
) -> Json
pub fn encode_shared_user(shared_user: SharedUser) -> Json
pub fn encode_shipping_address(
shipping_address: ShippingAddress,
) -> Json
pub fn encode_shipping_option(
shipping_option: ShippingOption,
) -> Json
pub fn encode_shipping_query(
shipping_query: ShippingQuery,
) -> Json
pub fn encode_star_transaction(
star_transaction: StarTransaction,
) -> Json
pub fn encode_star_transactions(
star_transactions: StarTransactions,
) -> Json
pub fn encode_sticker(sticker: Sticker) -> Json
pub fn encode_sticker_set(sticker_set: StickerSet) -> Json
pub fn encode_story(story: Story) -> Json
pub fn encode_successful_payment(
successful_payment: SuccessfulPayment,
) -> Json
pub fn encode_switch_inline_query_chosen_chat(
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat,
) -> Json
pub fn encode_text_quote(text_quote: TextQuote) -> Json
pub fn encode_transaction_partner(
value: TransactionPartner,
) -> Json
pub fn encode_transaction_partner_affiliate_program(
transaction_partner_affiliate_program: TransactionPartnerAffiliateProgram,
) -> Json
pub fn encode_transaction_partner_chat(
transaction_partner_chat: TransactionPartnerChat,
) -> Json
pub fn encode_transaction_partner_fragment(
transaction_partner_fragment: TransactionPartnerFragment,
) -> Json
pub fn encode_transaction_partner_other(
transaction_partner_other: TransactionPartnerOther,
) -> Json
pub fn encode_transaction_partner_telegram_ads(
transaction_partner_telegram_ads: TransactionPartnerTelegramAds,
) -> Json
pub fn encode_transaction_partner_telegram_api(
transaction_partner_telegram_api: TransactionPartnerTelegramApi,
) -> Json
pub fn encode_transaction_partner_user(
transaction_partner_user: TransactionPartnerUser,
) -> Json
pub fn encode_update(update: Update) -> Json
pub fn encode_user(user: User) -> Json
pub fn encode_user_chat_boosts(
user_chat_boosts: UserChatBoosts,
) -> Json
pub fn encode_user_profile_photos(
user_profile_photos: UserProfilePhotos,
) -> Json
pub fn encode_users_shared(users_shared: UsersShared) -> Json
pub fn encode_venue(venue: Venue) -> Json
pub fn encode_video(video: Video) -> Json
pub fn encode_video_chat_ended(
video_chat_ended: VideoChatEnded,
) -> Json
pub fn encode_video_chat_participants_invited(
video_chat_participants_invited: VideoChatParticipantsInvited,
) -> Json
pub fn encode_video_chat_scheduled(
video_chat_scheduled: VideoChatScheduled,
) -> Json
pub fn encode_video_chat_started(
video_chat_started: VideoChatStarted,
) -> Json
pub fn encode_video_note(video_note: VideoNote) -> Json
pub fn encode_voice(voice: Voice) -> Json
pub fn encode_web_app_data(web_app_data: WebAppData) -> Json
pub fn encode_web_app_info(web_app_info: WebAppInfo) -> Json
pub fn encode_webhook_info(webhook_info: WebhookInfo) -> Json
pub fn encode_write_access_allowed(
write_access_allowed: WriteAccessAllowed,
) -> Json
pub fn encrypted_credentials_decoder() -> Decoder(
EncryptedCredentials,
)
pub fn encrypted_passport_element_decoder() -> Decoder(
EncryptedPassportElement,
)
pub fn external_reply_info_decoder() -> Decoder(ExternalReplyInfo)
pub fn file_decoder() -> Decoder(File)
pub fn file_or_string_decoder() -> Decoder(FileOrString)
pub fn force_reply_decoder() -> Decoder(ForceReply)
pub fn forum_topic_closed_decoder() -> Decoder(ForumTopicClosed)
pub fn forum_topic_created_decoder() -> Decoder(ForumTopicCreated)
pub fn forum_topic_decoder() -> Decoder(ForumTopic)
pub fn forum_topic_edited_decoder() -> Decoder(ForumTopicEdited)
pub fn forum_topic_reopened_decoder() -> Decoder(
ForumTopicReopened,
)
pub fn game_decoder() -> Decoder(Game)
pub fn game_high_score_decoder() -> Decoder(GameHighScore)
pub fn general_forum_topic_hidden_decoder() -> Decoder(
GeneralForumTopicHidden,
)
pub fn general_forum_topic_unhidden_decoder() -> Decoder(
GeneralForumTopicUnhidden,
)
pub fn gift_decoder() -> Decoder(Gift)
pub fn gifts_decoder() -> Decoder(Gifts)
pub fn giveaway_completed_decoder() -> Decoder(GiveawayCompleted)
pub fn giveaway_created_decoder() -> Decoder(GiveawayCreated)
pub fn giveaway_decoder() -> Decoder(Giveaway)
pub fn giveaway_winners_decoder() -> Decoder(GiveawayWinners)
pub fn inaccessible_message_decoder() -> Decoder(
InaccessibleMessage,
)
pub fn inline_keyboard_button_decoder() -> Decoder(
InlineKeyboardButton,
)
pub fn inline_keyboard_markup_decoder() -> Decoder(
InlineKeyboardMarkup,
)
pub fn inline_query_decoder() -> Decoder(InlineQuery)
pub fn inline_query_result_article_decoder() -> Decoder(
InlineQueryResultArticle,
)
pub fn inline_query_result_audio_decoder() -> Decoder(
InlineQueryResultAudio,
)
pub fn inline_query_result_cached_audio_decoder() -> Decoder(
InlineQueryResultCachedAudio,
)
pub fn inline_query_result_cached_document_decoder() -> Decoder(
InlineQueryResultCachedDocument,
)
pub fn inline_query_result_cached_gif_decoder() -> Decoder(
InlineQueryResultCachedGif,
)
pub fn inline_query_result_cached_mpeg4_gif_decoder() -> Decoder(
InlineQueryResultCachedMpeg4Gif,
)
pub fn inline_query_result_cached_photo_decoder() -> Decoder(
InlineQueryResultCachedPhoto,
)
pub fn inline_query_result_cached_sticker_decoder() -> Decoder(
InlineQueryResultCachedSticker,
)
pub fn inline_query_result_cached_video_decoder() -> Decoder(
InlineQueryResultCachedVideo,
)
pub fn inline_query_result_cached_voice_decoder() -> Decoder(
InlineQueryResultCachedVoice,
)
pub fn inline_query_result_contact_decoder() -> Decoder(
InlineQueryResultContact,
)
pub fn inline_query_result_decoder() -> Decoder(InlineQueryResult)
pub fn inline_query_result_document_decoder() -> Decoder(
InlineQueryResultDocument,
)
pub fn inline_query_result_game_decoder() -> Decoder(
InlineQueryResultGame,
)
pub fn inline_query_result_gif_decoder() -> Decoder(
InlineQueryResultGif,
)
pub fn inline_query_result_location_decoder() -> Decoder(
InlineQueryResultLocation,
)
pub fn inline_query_result_mpeg4_gif_decoder() -> Decoder(
InlineQueryResultMpeg4Gif,
)
pub fn inline_query_result_photo_decoder() -> Decoder(
InlineQueryResultPhoto,
)
pub fn inline_query_result_venue_decoder() -> Decoder(
InlineQueryResultVenue,
)
pub fn inline_query_result_video_decoder() -> Decoder(
InlineQueryResultVideo,
)
pub fn inline_query_result_voice_decoder() -> Decoder(
InlineQueryResultVoice,
)
pub fn inline_query_results_button_decoder() -> Decoder(
InlineQueryResultsButton,
)
pub fn input_contact_message_content_decoder() -> Decoder(
InputContactMessageContent,
)
pub fn input_invoice_message_content_decoder() -> Decoder(
InputInvoiceMessageContent,
)
pub fn input_location_message_content_decoder() -> Decoder(
InputLocationMessageContent,
)
pub fn input_media_animation_decoder() -> Decoder(
InputMediaAnimation,
)
pub fn input_media_audio_decoder() -> Decoder(InputMediaAudio)
pub fn input_media_decoder() -> Decoder(InputMedia)
pub fn input_media_document_decoder() -> Decoder(
InputMediaDocument,
)
pub fn input_media_photo_decoder() -> Decoder(InputMediaPhoto)
pub fn input_media_video_decoder() -> Decoder(InputMediaVideo)
pub fn input_message_content_decoder() -> Decoder(
InputMessageContent,
)
pub fn input_paid_media_decoder() -> Decoder(InputPaidMedia)
pub fn input_paid_media_photo_decoder() -> Decoder(
InputPaidMediaPhoto,
)
pub fn input_paid_media_video_decoder() -> Decoder(
InputPaidMediaVideo,
)
pub fn input_poll_option_decoder() -> Decoder(InputPollOption)
pub fn input_sticker_decoder() -> Decoder(InputSticker)
pub fn input_text_message_content_decoder() -> Decoder(
InputTextMessageContent,
)
pub fn input_venue_message_content_decoder() -> Decoder(
InputVenueMessageContent,
)
pub fn int_or_string_decoder() -> Decoder(IntOrString)
pub fn invoice_decoder() -> Decoder(Invoice)
pub fn json_object_filter_nulls(
entries: List(#(String, Json)),
) -> Json
pub fn keyboard_button_decoder() -> Decoder(KeyboardButton)
pub fn keyboard_button_poll_type_decoder() -> Decoder(
KeyboardButtonPollType,
)
pub fn keyboard_button_request_chat_decoder() -> Decoder(
KeyboardButtonRequestChat,
)
pub fn keyboard_button_request_users_decoder() -> Decoder(
KeyboardButtonRequestUsers,
)
pub fn labeled_price_decoder() -> Decoder(LabeledPrice)
pub fn link_preview_options_decoder() -> Decoder(
LinkPreviewOptions,
)
pub fn location_decoder() -> Decoder(Location)
pub fn login_url_decoder() -> Decoder(LoginUrl)
pub fn mask_position_decoder() -> Decoder(MaskPosition)
pub fn maybe_inaccessible_message_decoder() -> Decoder(
MaybeInaccessibleMessage,
)
pub fn menu_button_commands_decoder() -> Decoder(
MenuButtonCommands,
)
pub fn menu_button_decoder() -> Decoder(MenuButton)
pub fn menu_button_default_decoder() -> Decoder(MenuButtonDefault)
pub fn menu_button_web_app_decoder() -> Decoder(MenuButtonWebApp)
pub fn message_auto_delete_timer_changed_decoder() -> Decoder(
MessageAutoDeleteTimerChanged,
)
pub fn message_decoder() -> Decoder(Message)
pub fn message_entity_decoder() -> Decoder(MessageEntity)
pub fn message_id_decoder() -> Decoder(MessageId)
pub fn message_origin_channel_decoder() -> Decoder(
MessageOriginChannel,
)
pub fn message_origin_chat_decoder() -> Decoder(MessageOriginChat)
pub fn message_origin_decoder() -> Decoder(MessageOrigin)
pub fn message_origin_hidden_user_decoder() -> Decoder(
MessageOriginHiddenUser,
)
pub fn message_origin_user_decoder() -> Decoder(MessageOriginUser)
pub fn message_reaction_count_updated_decoder() -> Decoder(
MessageReactionCountUpdated,
)
pub fn message_reaction_updated_decoder() -> Decoder(
MessageReactionUpdated,
)
pub fn new_answer_callback_query_parameters(
callback_query_id: String,
) -> AnswerCallbackQueryParameters
pub fn order_info_decoder() -> Decoder(OrderInfo)
pub fn paid_media_decoder() -> Decoder(PaidMedia)
pub fn paid_media_info_decoder() -> Decoder(PaidMediaInfo)
pub fn paid_media_photo_decoder() -> Decoder(PaidMediaPhoto)
pub fn paid_media_preview_decoder() -> Decoder(PaidMediaPreview)
pub fn paid_media_purchased_decoder() -> Decoder(
PaidMediaPurchased,
)
pub fn paid_media_video_decoder() -> Decoder(PaidMediaVideo)
pub fn passport_data_decoder() -> Decoder(PassportData)
pub fn passport_element_error_data_field_decoder() -> Decoder(
PassportElementErrorDataField,
)
pub fn passport_element_error_decoder() -> Decoder(
PassportElementError,
)
pub fn passport_element_error_file_decoder() -> Decoder(
PassportElementErrorFile,
)
pub fn passport_element_error_files_decoder() -> Decoder(
PassportElementErrorFiles,
)
pub fn passport_element_error_front_side_decoder() -> Decoder(
PassportElementErrorFrontSide,
)
pub fn passport_element_error_reverse_side_decoder() -> Decoder(
PassportElementErrorReverseSide,
)
pub fn passport_element_error_selfie_decoder() -> Decoder(
PassportElementErrorSelfie,
)
pub fn passport_element_error_translation_file_decoder() -> Decoder(
PassportElementErrorTranslationFile,
)
pub fn passport_element_error_translation_files_decoder() -> Decoder(
PassportElementErrorTranslationFiles,
)
pub fn passport_element_error_unspecified_decoder() -> Decoder(
PassportElementErrorUnspecified,
)
pub fn passport_file_decoder() -> Decoder(PassportFile)
pub fn photo_size_decoder() -> Decoder(PhotoSize)
pub fn poll_answer_decoder() -> Decoder(PollAnswer)
pub fn poll_decoder() -> Decoder(Poll)
pub fn poll_option_decoder() -> Decoder(PollOption)
pub fn pre_checkout_query_decoder() -> Decoder(PreCheckoutQuery)
pub fn prepared_inline_message_decoder() -> Decoder(
PreparedInlineMessage,
)
pub fn proximity_alert_triggered_decoder() -> Decoder(
ProximityAlertTriggered,
)
pub fn reaction_count_decoder() -> Decoder(ReactionCount)
pub fn reaction_type_custom_emoji_decoder() -> Decoder(
ReactionTypeCustomEmoji,
)
pub fn reaction_type_decoder() -> Decoder(ReactionType)
pub fn reaction_type_emoji_decoder() -> Decoder(ReactionTypeEmoji)
pub fn reaction_type_paid_decoder() -> Decoder(ReactionTypePaid)
pub fn refunded_payment_decoder() -> Decoder(RefundedPayment)
pub fn reply_keyboard_markup_decoder() -> Decoder(
ReplyKeyboardMarkup,
)
pub fn reply_keyboard_remove_decoder() -> Decoder(
ReplyKeyboardRemove,
)
pub fn reply_parameters_decoder() -> Decoder(ReplyParameters)
pub fn response_parameters_decoder() -> Decoder(
ResponseParameters,
)
pub fn revenue_withdrawal_state_decoder() -> Decoder(
RevenueWithdrawalState,
)
pub fn revenue_withdrawal_state_failed_decoder() -> Decoder(
RevenueWithdrawalStateFailed,
)
pub fn revenue_withdrawal_state_pending_decoder() -> Decoder(
RevenueWithdrawalStatePending,
)
pub fn revenue_withdrawal_state_succeeded_decoder() -> Decoder(
RevenueWithdrawalStateSucceeded,
)
pub fn sent_web_app_message_decoder() -> Decoder(
SentWebAppMessage,
)
pub fn shared_user_decoder() -> Decoder(SharedUser)
pub fn shipping_address_decoder() -> Decoder(ShippingAddress)
pub fn shipping_option_decoder() -> Decoder(ShippingOption)
pub fn shipping_query_decoder() -> Decoder(ShippingQuery)
pub fn star_transaction_decoder() -> Decoder(StarTransaction)
pub fn star_transactions_decoder() -> Decoder(StarTransactions)
pub fn sticker_decoder() -> Decoder(Sticker)
pub fn sticker_set_decoder() -> Decoder(StickerSet)
pub fn story_decoder() -> Decoder(Story)
pub fn successful_payment_decoder() -> Decoder(SuccessfulPayment)
pub fn switch_inline_query_chosen_chat_decoder() -> Decoder(
SwitchInlineQueryChosenChat,
)
pub fn text_quote_decoder() -> Decoder(TextQuote)
pub fn transaction_partner_affiliate_program_decoder() -> Decoder(
TransactionPartnerAffiliateProgram,
)
pub fn transaction_partner_chat_decoder() -> Decoder(
TransactionPartnerChat,
)
pub fn transaction_partner_decoder() -> Decoder(
TransactionPartner,
)
pub fn transaction_partner_fragment_decoder() -> Decoder(
TransactionPartnerFragment,
)
pub fn transaction_partner_other_decoder() -> Decoder(
TransactionPartnerOther,
)
pub fn transaction_partner_telegram_ads_decoder() -> Decoder(
TransactionPartnerTelegramAds,
)
pub fn transaction_partner_telegram_api_decoder() -> Decoder(
TransactionPartnerTelegramApi,
)
pub fn transaction_partner_user_decoder() -> Decoder(
TransactionPartnerUser,
)
pub fn update_decoder() -> Decoder(Update)
pub fn user_chat_boosts_decoder() -> Decoder(UserChatBoosts)
pub fn user_decoder() -> Decoder(User)
pub fn user_profile_photos_decoder() -> Decoder(UserProfilePhotos)
pub fn users_shared_decoder() -> Decoder(UsersShared)
pub fn venue_decoder() -> Decoder(Venue)
pub fn video_chat_ended_decoder() -> Decoder(VideoChatEnded)
pub fn video_chat_participants_invited_decoder() -> Decoder(
VideoChatParticipantsInvited,
)
pub fn video_chat_scheduled_decoder() -> Decoder(
VideoChatScheduled,
)
pub fn video_chat_started_decoder() -> Decoder(VideoChatStarted)
pub fn video_decoder() -> Decoder(Video)
pub fn video_note_decoder() -> Decoder(VideoNote)
pub fn voice_decoder() -> Decoder(Voice)
pub fn web_app_data_decoder() -> Decoder(WebAppData)
pub fn web_app_info_decoder() -> Decoder(WebAppInfo)
pub fn webhook_info_decoder() -> Decoder(WebhookInfo)
pub fn write_access_allowed_decoder() -> Decoder(
WriteAccessAllowed,
)