telegram_typings/lib.rs
1#[macro_use]
2extern crate serde_derive;
3extern crate serde;
4
5/// A placeholder, currently holds no information. Use BotFather to set up
6/// your game.
7#[derive(Serialize, Deserialize, Debug, Clone)]
8pub struct CallbackGame {}
9
10/// This object represents the content of a message to be sent as a result
11/// of an inline query.
12#[derive(Serialize, Deserialize, Debug, Clone)]
13pub enum InputMessageContent {
14 InputTextMessageContent(Box<InputTextMessageContent>),
15 InputLocationMessageContent(Box<InputLocationMessageContent>),
16 InputVenueMessageContent(Box<InputVenueMessageContent>),
17 InputContactMessageContent(Box<InputContactMessageContent>),
18}
19
20/// This object represents an incoming update.At most one of the optional
21/// parameters can be present in any given update.
22/// See https://core.telegram.org/bots/api#available-types
23#[derive(Serialize, Deserialize, Debug, Clone)]
24pub struct Update {
25 /// The update‘s unique identifier. Update identifiers start from a certain
26 /// positive number and increase sequentially. This ID becomes especially
27 /// handy if you’re using Webhooks, since it allows you to ignore repeated
28 /// updates or to restore the correct update sequence, should they get out
29 /// of order. If there are no new updates for at least a week, then
30 /// identifier of the next update will be chosen randomly instead of sequentially.
31 /// See https://core.telegram.org/bots/api#setwebhook
32 pub update_id: i64,
33
34 /// New incoming message of any kind — text, photo, sticker, etc.
35 pub message: Option<Box<Message>>,
36
37 /// New version of a message that is known to the bot and was edited
38 pub edited_message: Option<Box<Message>>,
39
40 /// New incoming channel post of any kind — text, photo, sticker, etc.
41 pub channel_post: Option<Box<Message>>,
42
43 /// New version of a channel post that is known to the bot and was edited
44 pub edited_channel_post: Option<Box<Message>>,
45
46 /// New incoming inline query
47 /// See https://core.telegram.org/bots/api#inline-mode
48 pub inline_query: Option<Box<InlineQuery>>,
49
50 /// The result of an inline query that was chosen by a user and sent to
51 /// their chat partner. Please see our documentation on the feedback
52 /// collecting for details on how to enable these updates for your bot.
53 /// See https://core.telegram.org/bots/api#inline-mode
54 /// See https://core.telegram.org/bots/api/bots/inline#collecting-feedback
55 pub chosen_inline_result: Option<Box<ChosenInlineResult>>,
56
57 /// New incoming callback query
58 pub callback_query: Option<Box<CallbackQuery>>,
59
60 /// New incoming shipping query. Only for invoices with flexible price
61 pub shipping_query: Option<Box<ShippingQuery>>,
62
63 /// New incoming pre-checkout query. Contains full information about checkout
64 pub pre_checkout_query: Option<Box<PreCheckoutQuery>>,
65}
66
67/// Contains information about the current status of a webhook.
68#[derive(Serialize, Deserialize, Debug, Clone)]
69pub struct WebhookInfo {
70 /// Webhook URL, may be empty if webhook is not set up
71 pub url: String,
72
73 /// True, if a custom certificate was provided for webhook certificate checks
74 pub has_custom_certificate: bool,
75
76 /// Number of updates awaiting delivery
77 pub pending_update_count: i64,
78
79 /// Unix time for the most recent error that happened when trying to deliver
80 /// an update via webhook
81 pub last_error_date: Option<i64>,
82
83 /// Error message in human-readable format for the most recent error that
84 /// happened when trying to deliver an update via webhook
85 pub last_error_message: Option<String>,
86
87 /// Maximum allowed number of simultaneous HTTPS connections to the webhook
88 /// for update delivery
89 pub max_connections: Option<i64>,
90
91 /// A list of update types the bot is subscribed to. Defaults to all update types
92 pub allowed_updates: Option<Vec<String>>,
93}
94
95/// This object represents a Telegram user or bot.
96#[derive(Serialize, Deserialize, Debug, Clone)]
97pub struct User {
98 /// Unique identifier for this user or bot
99 pub id: i64,
100
101 /// True, if this user is a bot
102 pub is_bot: bool,
103
104 /// User‘s or bot’s first name
105 pub first_name: String,
106
107 /// User‘s or bot’s last name
108 pub last_name: Option<String>,
109
110 /// User‘s or bot’s username
111 pub username: Option<String>,
112
113 /// IETF language tag of the user's language
114 /// See https://en.wikipedia.org/wiki/IETF_language_tag
115 pub language_code: Option<String>,
116}
117
118/// This object represents a chat.
119#[derive(Serialize, Deserialize, Debug, Clone)]
120pub struct Chat {
121 /// Unique identifier for this chat. This number may be greater than 32 bits
122 /// and some programming languages may have difficulty/silent defects in
123 /// interpreting it. But it is smaller than 52 bits, so a signed 64 bit
124 /// integer or double-precision float type are safe for storing this identifier.
125 pub id: i64,
126
127 /// Type of chat, can be either “private”, “group”, “supergroup” or “channel”
128 #[serde(rename = "type")]
129 pub type_tl: String,
130
131 /// Title, for supergroups, channels and group chats
132 pub title: Option<String>,
133
134 /// Username, for private chats, supergroups and channels if available
135 pub username: Option<String>,
136
137 /// First name of the other party in a private chat
138 pub first_name: Option<String>,
139
140 /// Last name of the other party in a private chat
141 pub last_name: Option<String>,
142
143 /// True if a group has ‘All Members Are Admins’ enabled.
144 pub all_members_are_administrators: Option<bool>,
145
146 /// Chat photo. Returned only in getChat.
147 /// See https://core.telegram.org/bots/api#getchat
148 pub photo: Option<Box<ChatPhoto>>,
149
150 /// Description, for supergroups and channel chats. Returned only in getChat.
151 /// See https://core.telegram.org/bots/api#getchat
152 pub description: Option<String>,
153
154 /// Chat invite link, for supergroups and channel chats. Returned only in getChat.
155 /// See https://core.telegram.org/bots/api#getchat
156 pub invite_link: Option<String>,
157
158 /// Pinned message, for supergroups and channel chats. Returned only in getChat.
159 /// See https://core.telegram.org/bots/api#getchat
160 pub pinned_message: Option<Box<Message>>,
161
162 /// For supergroups, name of group sticker set. Returned only in getChat.
163 /// See https://core.telegram.org/bots/api#getchat
164 pub sticker_set_name: Option<String>,
165
166 /// True, if the bot can change the group sticker set. Returned only in getChat.
167 /// See https://core.telegram.org/bots/api#getchat
168 pub can_set_sticker_set: Option<bool>,
169}
170
171/// This object represents a message.
172#[derive(Serialize, Deserialize, Debug, Clone)]
173pub struct Message {
174 /// Unique message identifier inside this chat
175 pub message_id: i64,
176
177 /// Sender, empty for messages sent to channels
178 pub from: Option<Box<User>>,
179
180 /// Date the message was sent in Unix time
181 pub date: i64,
182
183 /// Conversation the message belongs to
184 pub chat: Box<Chat>,
185
186 /// For forwarded messages, sender of the original message
187 pub forward_from: Option<Box<User>>,
188
189 /// For messages forwarded from channels, information about the original channel
190 pub forward_from_chat: Option<Box<Chat>>,
191
192 /// For messages forwarded from channels, identifier of the original message
193 /// in the channel
194 pub forward_from_message_id: Option<i64>,
195
196 /// For messages forwarded from channels, signature of the post author if present
197 pub forward_signature: Option<String>,
198
199 /// For forwarded messages, date the original message was sent in Unix time
200 pub forward_date: Option<i64>,
201
202 /// For replies, the original message. Note that the Message object in this
203 /// field will not contain further reply_to_message fields even if it itself
204 /// is a reply.
205 pub reply_to_message: Option<Box<Message>>,
206
207 /// Date the message was last edited in Unix time
208 pub edit_date: Option<i64>,
209
210 /// The unique identifier of a media message group this message belongs to
211 pub media_group_id: Option<String>,
212
213 /// Signature of the post author for messages in channels
214 pub author_signature: Option<String>,
215
216 /// For text messages, the actual UTF-8 text of the message, 0-4096 characters.
217 pub text: Option<String>,
218
219 /// For text messages, special entities like usernames, URLs, bot commands,
220 /// etc. that appear in the text
221 pub entities: Option<Vec<Box<MessageEntity>>>,
222
223 /// For messages with a caption, special entities like usernames, URLs, bot
224 /// commands, etc. that appear in the caption
225 pub caption_entities: Option<Vec<Box<MessageEntity>>>,
226
227 /// Message is an audio file, information about the file
228 pub audio: Option<Box<Audio>>,
229
230 /// Message is a general file, information about the file
231 pub document: Option<Box<Document>>,
232
233 /// Message is a game, information about the game. More about games »
234 /// See https://core.telegram.org/bots/api#games
235 pub game: Option<Box<Game>>,
236
237 /// Message is a photo, available sizes of the photo
238 pub photo: Option<Vec<Box<PhotoSize>>>,
239
240 /// Message is a sticker, information about the sticker
241 pub sticker: Option<Box<Sticker>>,
242
243 /// Message is a video, information about the video
244 pub video: Option<Box<Video>>,
245
246 /// Message is a voice message, information about the file
247 pub voice: Option<Box<Voice>>,
248
249 /// Message is a video note, information about the video message
250 /// See https://telegram.org/blog/video-messages-and-telescope
251 pub video_note: Option<Box<VideoNote>>,
252
253 /// Caption for the audio, document, photo, video or voice, 0-200 characters
254 pub caption: Option<String>,
255
256 /// Message is a shared contact, information about the contact
257 pub contact: Option<Box<Contact>>,
258
259 /// Message is a shared location, information about the location
260 pub location: Option<Box<Location>>,
261
262 /// Message is a venue, information about the venue
263 pub venue: Option<Box<Venue>>,
264
265 /// New members that were added to the group or supergroup and information
266 /// about them (the bot itself may be one of these members)
267 pub new_chat_members: Option<Vec<Box<User>>>,
268
269 /// A member was removed from the group, information about them (this member
270 /// may be the bot itself)
271 pub left_chat_member: Option<Box<User>>,
272
273 /// A chat title was changed to this value
274 pub new_chat_title: Option<String>,
275
276 /// A chat photo was change to this value
277 pub new_chat_photo: Option<Vec<Box<PhotoSize>>>,
278
279 /// Service message: the chat photo was deleted
280 pub delete_chat_photo: Option<bool>,
281
282 /// Service message: the group has been created
283 pub group_chat_created: Option<bool>,
284
285 /// Service message: the supergroup has been created. This field can‘t be
286 /// received in a message coming through updates, because bot can’t be a
287 /// member of a supergroup when it is created. It can only be found in
288 /// reply_to_message if someone replies to a very first message in a
289 /// directly created supergroup.
290 pub supergroup_chat_created: Option<bool>,
291
292 /// Service message: the channel has been created. This field can‘t be
293 /// received in a message coming through updates, because bot can’t be a
294 /// member of a channel when it is created. It can only be found in
295 /// reply_to_message if someone replies to a very first message in a channel.
296 pub channel_chat_created: Option<bool>,
297
298 /// The group has been migrated to a supergroup with the specified
299 /// identifier. This number may be greater than 32 bits and some programming
300 /// languages may have difficulty/silent defects in interpreting it. But it
301 /// is smaller than 52 bits, so a signed 64 bit integer or double-precision
302 /// float type are safe for storing this identifier.
303 pub migrate_to_chat_id: Option<i64>,
304
305 /// The supergroup has been migrated from a group with the specified
306 /// identifier. This number may be greater than 32 bits and some programming
307 /// languages may have difficulty/silent defects in interpreting it. But it
308 /// is smaller than 52 bits, so a signed 64 bit integer or double-precision
309 /// float type are safe for storing this identifier.
310 pub migrate_from_chat_id: Option<i64>,
311
312 /// Specified message was pinned. Note that the Message object in this field
313 /// will not contain further reply_to_message fields even if it is itself a reply.
314 pub pinned_message: Option<Box<Message>>,
315
316 /// Message is an invoice for a payment, information about the invoice. More
317 /// about payments »
318 /// See https://core.telegram.org/bots/api#payments
319 pub invoice: Option<Box<Invoice>>,
320
321 /// Message is a service message about a successful payment, information
322 /// about the payment. More about payments »
323 /// See https://core.telegram.org/bots/api#payments
324 pub successful_payment: Option<Box<SuccessfulPayment>>,
325
326 /// The domain name of the website on which the user has logged in. More
327 /// about Telegram Login »
328 /// See https://core.telegram.org/bots/api/widgets/login
329 pub connected_website: Option<String>,
330}
331
332/// This object represents one special entity in a text message. For
333/// example, hashtags, usernames, URLs, etc.
334#[derive(Serialize, Deserialize, Debug, Clone)]
335pub struct MessageEntity {
336 /// Type of the entity. Can be mention (@username), hashtag, bot_command,
337 /// url, email, bold (bold text), italic (italic text), code (monowidth
338 /// string), pre (monowidth block), text_link (for clickable text URLs),
339 /// text_mention (for users without usernames)
340 /// See https://telegram.org/blog/edit#new-mentions
341 #[serde(rename = "type")]
342 pub type_tl: String,
343
344 /// Offset in UTF-16 code units to the start of the entity
345 pub offset: i64,
346
347 /// Length of the entity in UTF-16 code units
348 pub length: i64,
349
350 /// For “text_link” only, url that will be opened after user taps on the text
351 pub url: Option<String>,
352
353 /// For “text_mention” only, the mentioned user
354 pub user: Option<Box<User>>,
355}
356
357/// This object represents one size of a photo or a file / sticker thumbnail.
358/// See https://core.telegram.org/bots/api#document
359/// See https://core.telegram.org/bots/api#sticker
360#[derive(Serialize, Deserialize, Debug, Clone)]
361pub struct PhotoSize {
362 /// Unique identifier for this file
363 pub file_id: String,
364
365 /// Photo width
366 pub width: i64,
367
368 /// Photo height
369 pub height: i64,
370
371 /// File size
372 pub file_size: Option<i64>,
373}
374
375/// This object represents an audio file to be treated as music by the
376/// Telegram clients.
377#[derive(Serialize, Deserialize, Debug, Clone)]
378pub struct Audio {
379 /// Unique identifier for this file
380 pub file_id: String,
381
382 /// Duration of the audio in seconds as defined by sender
383 pub duration: i64,
384
385 /// Performer of the audio as defined by sender or by audio tags
386 pub performer: Option<String>,
387
388 /// Title of the audio as defined by sender or by audio tags
389 pub title: Option<String>,
390
391 /// MIME type of the file as defined by sender
392 pub mime_type: Option<String>,
393
394 /// File size
395 pub file_size: Option<i64>,
396}
397
398/// This object represents a general file (as opposed to photos, voice
399/// messages and audio files).
400/// See https://core.telegram.org/bots/api#photosize
401/// See https://core.telegram.org/bots/api#voice
402/// See https://core.telegram.org/bots/api#audio
403#[derive(Serialize, Deserialize, Debug, Clone)]
404pub struct Document {
405 /// Unique file identifier
406 pub file_id: String,
407
408 /// Document thumbnail as defined by sender
409 pub thumb: Option<Box<PhotoSize>>,
410
411 /// Original filename as defined by sender
412 pub file_name: Option<String>,
413
414 /// MIME type of the file as defined by sender
415 pub mime_type: Option<String>,
416
417 /// File size
418 pub file_size: Option<i64>,
419}
420
421/// This object represents a video file.
422#[derive(Serialize, Deserialize, Debug, Clone)]
423pub struct Video {
424 /// Unique identifier for this file
425 pub file_id: String,
426
427 /// Video width as defined by sender
428 pub width: i64,
429
430 /// Video height as defined by sender
431 pub height: i64,
432
433 /// Duration of the video in seconds as defined by sender
434 pub duration: i64,
435
436 /// Video thumbnail
437 pub thumb: Option<Box<PhotoSize>>,
438
439 /// Mime type of a file as defined by sender
440 pub mime_type: Option<String>,
441
442 /// File size
443 pub file_size: Option<i64>,
444}
445
446/// This object represents a voice note.
447#[derive(Serialize, Deserialize, Debug, Clone)]
448pub struct Voice {
449 /// Unique identifier for this file
450 pub file_id: String,
451
452 /// Duration of the audio in seconds as defined by sender
453 pub duration: i64,
454
455 /// MIME type of the file as defined by sender
456 pub mime_type: Option<String>,
457
458 /// File size
459 pub file_size: Option<i64>,
460}
461
462/// This object represents a video message (available in Telegram apps as of v.4.0).
463/// See https://telegram.org/blog/video-messages-and-telescope
464#[derive(Serialize, Deserialize, Debug, Clone)]
465pub struct VideoNote {
466 /// Unique identifier for this file
467 pub file_id: String,
468
469 /// Video width and height as defined by sender
470 pub length: i64,
471
472 /// Duration of the video in seconds as defined by sender
473 pub duration: i64,
474
475 /// Video thumbnail
476 pub thumb: Option<Box<PhotoSize>>,
477
478 /// File size
479 pub file_size: Option<i64>,
480}
481
482/// This object represents a phone contact.
483#[derive(Serialize, Deserialize, Debug, Clone)]
484pub struct Contact {
485 /// Contact's phone number
486 pub phone_number: String,
487
488 /// Contact's first name
489 pub first_name: String,
490
491 /// Contact's last name
492 pub last_name: Option<String>,
493
494 /// Contact's user identifier in Telegram
495 pub user_id: Option<i64>,
496}
497
498/// This object represents a point on the map.
499#[derive(Serialize, Deserialize, Debug, Clone)]
500pub struct Location {
501 /// Longitude as defined by sender
502 pub longitude: f64,
503
504 /// Latitude as defined by sender
505 pub latitude: f64,
506}
507
508/// This object represents a venue.
509#[derive(Serialize, Deserialize, Debug, Clone)]
510pub struct Venue {
511 /// Venue location
512 pub location: Box<Location>,
513
514 /// Name of the venue
515 pub title: String,
516
517 /// Address of the venue
518 pub address: String,
519
520 /// Foursquare identifier of the venue
521 pub foursquare_id: Option<String>,
522}
523
524/// This object represent a user's profile pictures.
525#[derive(Serialize, Deserialize, Debug, Clone)]
526pub struct UserProfilePhotos {
527 /// Total number of profile pictures the target user has
528 pub total_count: i64,
529
530 /// Requested profile pictures (in up to 4 sizes each)
531 pub photos: Vec<Vec<Box<PhotoSize>>>,
532}
533
534/// This object represents a file ready to be downloaded. The file can be
535/// downloaded via the link
536/// https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed
537/// that the link will be valid for at least 1 hour. When the link expires,
538/// a new one can be requested by calling getFile.
539/// See https://core.telegram.org/bots/api#getfile
540#[derive(Serialize, Deserialize, Debug, Clone)]
541pub struct File {
542 /// Unique identifier for this file
543 pub file_id: String,
544
545 /// File size, if known
546 pub file_size: Option<i64>,
547
548 /// File path. Use https://api.telegram.org/file/bot<token>/<file_path> to
549 /// get the file.
550 pub file_path: Option<String>,
551}
552
553/// This object represents a custom keyboard with reply options (see
554/// Introduction to bots for details and examples).
555/// See https://core.telegram.org/bots#keyboards
556#[derive(Serialize, Deserialize, Debug, Clone)]
557pub struct ReplyKeyboardMarkup {
558 /// Array of button rows, each represented by an Array of KeyboardButton objects
559 /// See https://core.telegram.org/bots/api#keyboardbutton
560 pub keyboard: Vec<Vec<Box<KeyboardButton>>>,
561
562 /// Requests clients to resize the keyboard vertically for optimal fit
563 /// (e.g., make the keyboard smaller if there are just two rows of buttons).
564 /// Defaults to false, in which case the custom keyboard is always of the
565 /// same height as the app's standard keyboard.
566 pub resize_keyboard: Option<bool>,
567
568 /// Requests clients to hide the keyboard as soon as it's been used. The
569 /// keyboard will still be available, but clients will automatically display
570 /// the usual letter-keyboard in the chat – the user can press a special
571 /// button in the input field to see the custom keyboard again. Defaults to false.
572 pub one_time_keyboard: Option<bool>,
573
574 /// Use this parameter if you want to show the keyboard to specific users
575 /// only. Targets: 1) users that are @mentioned in the text of the Message
576 /// object; 2) if the bot's message is a reply (has reply_to_message_id),
577 /// sender of the original message.Example: A user requests to change the
578 /// bot‘s language, bot replies to the request with a keyboard to select the
579 /// new language. Other users in the group don’t see the keyboard.
580 /// See https://core.telegram.org/bots/api#message
581 pub selective: Option<bool>,
582}
583
584/// This object represents one button of the reply keyboard. For simple text
585/// buttons String can be used instead of this object to specify text of the
586/// button. Optional fields are mutually exclusive.
587#[derive(Serialize, Deserialize, Debug, Clone)]
588pub struct KeyboardButton {
589 /// Text of the button. If none of the optional fields are used, it will be
590 /// sent as a message when the button is pressed
591 pub text: String,
592
593 /// If True, the user's phone number will be sent as a contact when the
594 /// button is pressed. Available in private chats only
595 pub request_contact: Option<bool>,
596
597 /// If True, the user's current location will be sent when the button is
598 /// pressed. Available in private chats only
599 pub request_location: Option<bool>,
600}
601
602/// Upon receiving a message with this object, Telegram clients will remove
603/// the current custom keyboard and display the default letter-keyboard. By
604/// default, custom keyboards are displayed until a new keyboard is sent by
605/// a bot. An exception is made for one-time keyboards that are hidden
606/// immediately after the user presses a button (see ReplyKeyboardMarkup).
607/// See https://core.telegram.org/bots/api#replykeyboardmarkup
608#[derive(Serialize, Deserialize, Debug, Clone)]
609pub struct ReplyKeyboardRemove {
610 /// Requests clients to remove the custom keyboard (user will not be able to
611 /// summon this keyboard; if you want to hide the keyboard from sight but
612 /// keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
613 /// See https://core.telegram.org/bots/api#replykeyboardmarkup
614 pub remove_keyboard: bool,
615
616 /// Use this parameter if you want to remove the keyboard for specific users
617 /// only. Targets: 1) users that are @mentioned in the text of the Message
618 /// object; 2) if the bot's message is a reply (has reply_to_message_id),
619 /// sender of the original message.Example: A user votes in a poll, bot
620 /// returns confirmation message in reply to the vote and removes the
621 /// keyboard for that user, while still showing the keyboard with poll
622 /// options to users who haven't voted yet.
623 /// See https://core.telegram.org/bots/api#message
624 pub selective: Option<bool>,
625}
626
627/// This object represents an inline keyboard that appears right next to the
628/// message it belongs to.
629/// See https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
630#[derive(Serialize, Deserialize, Debug, Clone)]
631pub struct InlineKeyboardMarkup {
632 /// Array of button rows, each represented by an Array of
633 /// InlineKeyboardButton objects
634 /// See https://core.telegram.org/bots/api#inlinekeyboardbutton
635 pub inline_keyboard: Vec<Vec<Box<InlineKeyboardButton>>>,
636}
637
638/// This object represents one button of an inline keyboard. You must use
639/// exactly one of the optional fields.
640#[derive(Serialize, Deserialize, Debug, Clone)]
641pub struct InlineKeyboardButton {
642 /// Label text on the button
643 pub text: String,
644
645 /// HTTP url to be opened when button is pressed
646 pub url: Option<String>,
647
648 /// Data to be sent in a callback query to the bot when button is pressed,
649 /// 1-64 bytes
650 /// See https://core.telegram.org/bots/api#callbackquery
651 pub callback_data: Option<String>,
652
653 /// If set, pressing the button will prompt the user to select one of their
654 /// chats, open that chat and insert the bot‘s username and the specified
655 /// inline query in the input field. Can be empty, in which case just the
656 /// bot’s username will be inserted.Note: This offers an easy way for users
657 /// to start using your bot in inline mode when they are currently in a
658 /// private chat with it. Especially useful when combined with switch_pm…
659 /// actions – in this case the user will be automatically returned to the
660 /// chat they switched from, skipping the chat selection screen.
661 /// See https://core.telegram.org/bots/api/bots/inline
662 /// See https://core.telegram.org/bots/api#answerinlinequery
663 pub switch_inline_query: Option<String>,
664
665 /// If set, pressing the button will insert the bot‘s username and the
666 /// specified inline query in the current chat's input field. Can be empty,
667 /// in which case only the bot’s username will be inserted.This offers a
668 /// quick way for the user to open your bot in inline mode in the same chat
669 /// – good for selecting something from multiple options.
670 pub switch_inline_query_current_chat: Option<String>,
671
672 /// Description of the game that will be launched when the user presses the
673 /// button.NOTE: This type of button must always be the first button in the
674 /// first row.
675 pub callback_game: Option<Box<CallbackGame>>,
676
677 /// Specify True, to send a Pay button.NOTE: This type of button must always
678 /// be the first button in the first row.
679 /// See https://core.telegram.org/bots/api#payments
680 pub pay: Option<bool>,
681}
682
683/// This object represents an incoming callback query from a callback button
684/// in an inline keyboard. If the button that originated the query was
685/// attached to a message sent by the bot, the field message will be
686/// present. If the button was attached to a message sent via the bot (in
687/// inline mode), the field inline_message_id will be present. Exactly one
688/// of the fields data or game_short_name will be present.
689/// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
690/// See https://core.telegram.org/bots/api#inline-mode
691#[derive(Serialize, Deserialize, Debug, Clone)]
692pub struct CallbackQuery {
693 /// Unique identifier for this query
694 pub id: String,
695
696 /// Sender
697 pub from: Box<User>,
698
699 /// Message with the callback button that originated the query. Note that
700 /// message content and message date will not be available if the message is
701 /// too old
702 pub message: Option<Box<Message>>,
703
704 /// Identifier of the message sent via the bot in inline mode, that
705 /// originated the query.
706 pub inline_message_id: Option<String>,
707
708 /// Global identifier, uniquely corresponding to the chat to which the
709 /// message with the callback button was sent. Useful for high scores in games.
710 /// See https://core.telegram.org/bots/api#games
711 pub chat_instance: String,
712
713 /// Data associated with the callback button. Be aware that a bad client can
714 /// send arbitrary data in this field.
715 pub data: Option<String>,
716
717 /// Short name of a Game to be returned, serves as the unique identifier for
718 /// the game
719 /// See https://core.telegram.org/bots/api#games
720 pub game_short_name: Option<String>,
721}
722
723/// Upon receiving a message with this object, Telegram clients will display
724/// a reply interface to the user (act as if the user has selected the bot‘s
725/// message and tapped ’Reply'). This can be extremely useful if you want to
726/// create user-friendly step-by-step interfaces without having to sacrifice
727/// privacy mode.
728/// See https://core.telegram.org/bots/api/bots#privacy-mode
729#[derive(Serialize, Deserialize, Debug, Clone)]
730pub struct ForceReply {
731 /// Shows reply interface to the user, as if they manually selected the
732 /// bot‘s message and tapped ’Reply'
733 pub force_reply: bool,
734
735 /// Use this parameter if you want to force reply from specific users only.
736 /// Targets: 1) users that are @mentioned in the text of the Message object;
737 /// 2) if the bot's message is a reply (has reply_to_message_id), sender of
738 /// the original message.
739 /// See https://core.telegram.org/bots/api#message
740 pub selective: Option<bool>,
741}
742
743/// This object represents a chat photo.
744#[derive(Serialize, Deserialize, Debug, Clone)]
745pub struct ChatPhoto {
746 /// Unique file identifier of small (160x160) chat photo. This file_id can
747 /// be used only for photo download.
748 pub small_file_id: String,
749
750 /// Unique file identifier of big (640x640) chat photo. This file_id can be
751 /// used only for photo download.
752 pub big_file_id: String,
753}
754
755/// This object contains information about one member of a chat.
756#[derive(Serialize, Deserialize, Debug, Clone)]
757pub struct ChatMember {
758 /// Information about the user
759 pub user: Box<User>,
760
761 /// The member's status in the chat. Can be “creator”, “administrator”,
762 /// “member”, “restricted”, “left” or “kicked”
763 pub status: String,
764
765 /// Restricted and kicked only. Date when restrictions will be lifted for
766 /// this user, unix time
767 pub until_date: Option<i64>,
768
769 /// Administrators only. True, if the bot is allowed to edit administrator
770 /// privileges of that user
771 pub can_be_edited: Option<bool>,
772
773 /// Administrators only. True, if the administrator can change the chat
774 /// title, photo and other settings
775 pub can_change_info: Option<bool>,
776
777 /// Administrators only. True, if the administrator can post in the channel,
778 /// channels only
779 pub can_post_messages: Option<bool>,
780
781 /// Administrators only. True, if the administrator can edit messages of
782 /// other users and can pin messages, channels only
783 pub can_edit_messages: Option<bool>,
784
785 /// Administrators only. True, if the administrator can delete messages of
786 /// other users
787 pub can_delete_messages: Option<bool>,
788
789 /// Administrators only. True, if the administrator can invite new users to
790 /// the chat
791 pub can_invite_users: Option<bool>,
792
793 /// Administrators only. True, if the administrator can restrict, ban or
794 /// unban chat members
795 pub can_restrict_members: Option<bool>,
796
797 /// Administrators only. True, if the administrator can pin messages,
798 /// supergroups only
799 pub can_pin_messages: Option<bool>,
800
801 /// Administrators only. True, if the administrator can add new
802 /// administrators with a subset of his own privileges or demote
803 /// administrators that he has promoted, directly or indirectly (promoted by
804 /// administrators that were appointed by the user)
805 pub can_promote_members: Option<bool>,
806
807 /// Restricted only. True, if the user can send text messages, contacts,
808 /// locations and venues
809 pub can_send_messages: Option<bool>,
810
811 /// Restricted only. True, if the user can send audios, documents, photos,
812 /// videos, video notes and voice notes, implies can_send_messages
813 pub can_send_media_messages: Option<bool>,
814
815 /// Restricted only. True, if the user can send animations, games, stickers
816 /// and use inline bots, implies can_send_media_messages
817 pub can_send_other_messages: Option<bool>,
818
819 /// Restricted only. True, if user may add web page previews to his
820 /// messages, implies can_send_media_messages
821 pub can_add_web_page_previews: Option<bool>,
822}
823
824/// Contains information about why a request was unsuccessful.
825#[derive(Serialize, Deserialize, Debug, Clone)]
826pub struct ResponseParameters {
827 /// The group has been migrated to a supergroup with the specified
828 /// identifier. This number may be greater than 32 bits and some programming
829 /// languages may have difficulty/silent defects in interpreting it. But it
830 /// is smaller than 52 bits, so a signed 64 bit integer or double-precision
831 /// float type are safe for storing this identifier.
832 pub migrate_to_chat_id: Option<i64>,
833
834 /// In case of exceeding flood control, the number of seconds left to wait
835 /// before the request can be repeated
836 pub retry_after: Option<i64>,
837}
838
839/// Represents a photo to be sent.
840#[derive(Serialize, Deserialize, Debug, Clone)]
841pub struct InputMediaPhoto {
842 /// Type of the result, must be photo
843 #[serde(rename = "type")]
844 pub type_tl: String,
845
846 /// File to send. Pass a file_id to send a file that exists on the Telegram
847 /// servers (recommended), pass an HTTP URL for Telegram to get a file from
848 /// the Internet, or pass "attach://<file_attach_name>" to upload a new one
849 /// using multipart/form-data under <file_attach_name> name. More info on
850 /// Sending Files »
851 /// See https://core.telegram.org/bots/api#sending-files
852 pub media: String,
853
854 /// Caption of the photo to be sent, 0-200 characters
855 pub caption: Option<String>,
856
857 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
858 /// fixed-width text or inline URLs in the media caption.
859 /// See https://core.telegram.org/bots/api#markdown-style
860 /// See https://core.telegram.org/bots/api#html-style
861 /// See https://core.telegram.org/bots/api#formatting-options
862 pub parse_mode: Option<String>,
863}
864
865/// Represents a video to be sent.
866#[derive(Serialize, Deserialize, Debug, Clone)]
867pub struct InputMediaVideo {
868 /// Type of the result, must be video
869 #[serde(rename = "type")]
870 pub type_tl: String,
871
872 /// File to send. Pass a file_id to send a file that exists on the Telegram
873 /// servers (recommended), pass an HTTP URL for Telegram to get a file from
874 /// the Internet, or pass "attach://<file_attach_name>" to upload a new one
875 /// using multipart/form-data under <file_attach_name> name. More info on
876 /// Sending Files »
877 /// See https://core.telegram.org/bots/api#sending-files
878 pub media: String,
879
880 /// Caption of the video to be sent, 0-200 characters
881 pub caption: Option<String>,
882
883 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
884 /// fixed-width text or inline URLs in the media caption.
885 /// See https://core.telegram.org/bots/api#markdown-style
886 /// See https://core.telegram.org/bots/api#html-style
887 /// See https://core.telegram.org/bots/api#formatting-options
888 pub parse_mode: Option<String>,
889
890 /// Video width
891 pub width: Option<i64>,
892
893 /// Video height
894 pub height: Option<i64>,
895
896 /// Video duration
897 pub duration: Option<i64>,
898
899 /// Pass True, if the uploaded video is suitable for streaming
900 pub supports_streaming: Option<bool>,
901}
902
903/// This object represents a sticker.
904#[derive(Serialize, Deserialize, Debug, Clone)]
905pub struct Sticker {
906 /// Unique identifier for this file
907 pub file_id: String,
908
909 /// Sticker width
910 pub width: i64,
911
912 /// Sticker height
913 pub height: i64,
914
915 /// Sticker thumbnail in the .webp or .jpg format
916 pub thumb: Option<Box<PhotoSize>>,
917
918 /// Emoji associated with the sticker
919 pub emoji: Option<String>,
920
921 /// Name of the sticker set to which the sticker belongs
922 pub set_name: Option<String>,
923
924 /// For mask stickers, the position where the mask should be placed
925 pub mask_position: Option<Box<MaskPosition>>,
926
927 /// File size
928 pub file_size: Option<i64>,
929}
930
931/// This object represents a sticker set.
932#[derive(Serialize, Deserialize, Debug, Clone)]
933pub struct StickerSet {
934 /// Sticker set name
935 pub name: String,
936
937 /// Sticker set title
938 pub title: String,
939
940 /// True, if the sticker set contains masks
941 pub contains_masks: bool,
942
943 /// List of all set stickers
944 pub stickers: Vec<Box<Sticker>>,
945}
946
947/// This object describes the position on faces where a mask should be
948/// placed by default.
949#[derive(Serialize, Deserialize, Debug, Clone)]
950pub struct MaskPosition {
951 /// The part of the face relative to which the mask should be placed. One of
952 /// “forehead”, “eyes”, “mouth”, or “chin”.
953 pub point: String,
954
955 /// Shift by X-axis measured in widths of the mask scaled to the face size,
956 /// from left to right. For example, choosing -1.0 will place mask just to
957 /// the left of the default mask position.
958 pub x_shift: f64,
959
960 /// Shift by Y-axis measured in heights of the mask scaled to the face size,
961 /// from top to bottom. For example, 1.0 will place the mask just below the
962 /// default mask position.
963 pub y_shift: f64,
964
965 /// Mask scaling coefficient. For example, 2.0 means double size.
966 pub scale: f64,
967}
968
969/// This object represents an incoming inline query. When the user sends an
970/// empty query, your bot could return some default or trending results.
971#[derive(Serialize, Deserialize, Debug, Clone)]
972pub struct InlineQuery {
973 /// Unique identifier for this query
974 pub id: String,
975
976 /// Sender
977 pub from: Box<User>,
978
979 /// Sender location, only for bots that request user location
980 pub location: Option<Box<Location>>,
981
982 /// Text of the query (up to 512 characters)
983 pub query: String,
984
985 /// Offset of the results to be returned, can be controlled by the bot
986 pub offset: String,
987}
988
989/// Represents a link to an article or web page.
990#[derive(Serialize, Deserialize, Debug, Clone)]
991pub struct InlineQueryResultArticle {
992 /// Type of the result, must be article
993 #[serde(rename = "type")]
994 pub type_tl: String,
995
996 /// Unique identifier for this result, 1-64 Bytes
997 pub id: String,
998
999 /// Title of the result
1000 pub title: String,
1001
1002 /// Content of the message to be sent
1003 pub input_message_content: Box<InputMessageContent>,
1004
1005 /// Inline keyboard attached to the message
1006 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1007 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1008
1009 /// URL of the result
1010 pub url: Option<String>,
1011
1012 /// Pass True, if you don't want the URL to be shown in the message
1013 pub hide_url: Option<bool>,
1014
1015 /// Short description of the result
1016 pub description: Option<String>,
1017
1018 /// Url of the thumbnail for the result
1019 pub thumb_url: Option<String>,
1020
1021 /// Thumbnail width
1022 pub thumb_width: Option<i64>,
1023
1024 /// Thumbnail height
1025 pub thumb_height: Option<i64>,
1026}
1027
1028/// Represents a link to a photo. By default, this photo will be sent by the
1029/// user with optional caption. Alternatively, you can use
1030/// input_message_content to send a message with the specified content
1031/// instead of the photo.
1032#[derive(Serialize, Deserialize, Debug, Clone)]
1033pub struct InlineQueryResultPhoto {
1034 /// Type of the result, must be photo
1035 #[serde(rename = "type")]
1036 pub type_tl: String,
1037
1038 /// Unique identifier for this result, 1-64 bytes
1039 pub id: String,
1040
1041 /// A valid URL of the photo. Photo must be in jpeg format. Photo size must
1042 /// not exceed 5MB
1043 pub photo_url: String,
1044
1045 /// URL of the thumbnail for the photo
1046 pub thumb_url: String,
1047
1048 /// Width of the photo
1049 pub photo_width: Option<i64>,
1050
1051 /// Height of the photo
1052 pub photo_height: Option<i64>,
1053
1054 /// Title for the result
1055 pub title: Option<String>,
1056
1057 /// Short description of the result
1058 pub description: Option<String>,
1059
1060 /// Caption of the photo to be sent, 0-200 characters
1061 pub caption: Option<String>,
1062
1063 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1064 /// fixed-width text or inline URLs in the media caption.
1065 /// See https://core.telegram.org/bots/api#markdown-style
1066 /// See https://core.telegram.org/bots/api#html-style
1067 /// See https://core.telegram.org/bots/api#formatting-options
1068 pub parse_mode: Option<String>,
1069
1070 /// Inline keyboard attached to the message
1071 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1072 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1073
1074 /// Content of the message to be sent instead of the photo
1075 pub input_message_content: Option<Box<InputMessageContent>>,
1076}
1077
1078/// Represents a link to an animated GIF file. By default, this animated GIF
1079/// file will be sent by the user with optional caption. Alternatively, you
1080/// can use input_message_content to send a message with the specified
1081/// content instead of the animation.
1082#[derive(Serialize, Deserialize, Debug, Clone)]
1083pub struct InlineQueryResultGif {
1084 /// Type of the result, must be gif
1085 #[serde(rename = "type")]
1086 pub type_tl: String,
1087
1088 /// Unique identifier for this result, 1-64 bytes
1089 pub id: String,
1090
1091 /// A valid URL for the GIF file. File size must not exceed 1MB
1092 pub gif_url: String,
1093
1094 /// Width of the GIF
1095 pub gif_width: Option<i64>,
1096
1097 /// Height of the GIF
1098 pub gif_height: Option<i64>,
1099
1100 /// Duration of the GIF
1101 pub gif_duration: Option<i64>,
1102
1103 /// URL of the static thumbnail for the result (jpeg or gif)
1104 pub thumb_url: String,
1105
1106 /// Title for the result
1107 pub title: Option<String>,
1108
1109 /// Caption of the GIF file to be sent, 0-200 characters
1110 pub caption: Option<String>,
1111
1112 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1113 /// fixed-width text or inline URLs in the media caption.
1114 /// See https://core.telegram.org/bots/api#markdown-style
1115 /// See https://core.telegram.org/bots/api#html-style
1116 /// See https://core.telegram.org/bots/api#formatting-options
1117 pub parse_mode: Option<String>,
1118
1119 /// Inline keyboard attached to the message
1120 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1121 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1122
1123 /// Content of the message to be sent instead of the GIF animation
1124 pub input_message_content: Option<Box<InputMessageContent>>,
1125}
1126
1127/// Represents a link to a video animation (H.264/MPEG-4 AVC video without
1128/// sound). By default, this animated MPEG-4 file will be sent by the user
1129/// with optional caption. Alternatively, you can use input_message_content
1130/// to send a message with the specified content instead of the animation.
1131#[derive(Serialize, Deserialize, Debug, Clone)]
1132pub struct InlineQueryResultMpeg4Gif {
1133 /// Type of the result, must be mpeg4_gif
1134 #[serde(rename = "type")]
1135 pub type_tl: String,
1136
1137 /// Unique identifier for this result, 1-64 bytes
1138 pub id: String,
1139
1140 /// A valid URL for the MP4 file. File size must not exceed 1MB
1141 pub mpeg4_url: String,
1142
1143 /// Video width
1144 pub mpeg4_width: Option<i64>,
1145
1146 /// Video height
1147 pub mpeg4_height: Option<i64>,
1148
1149 /// Video duration
1150 pub mpeg4_duration: Option<i64>,
1151
1152 /// URL of the static thumbnail (jpeg or gif) for the result
1153 pub thumb_url: String,
1154
1155 /// Title for the result
1156 pub title: Option<String>,
1157
1158 /// Caption of the MPEG-4 file to be sent, 0-200 characters
1159 pub caption: Option<String>,
1160
1161 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1162 /// fixed-width text or inline URLs in the media caption.
1163 /// See https://core.telegram.org/bots/api#markdown-style
1164 /// See https://core.telegram.org/bots/api#html-style
1165 /// See https://core.telegram.org/bots/api#formatting-options
1166 pub parse_mode: Option<String>,
1167
1168 /// Inline keyboard attached to the message
1169 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1170 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1171
1172 /// Content of the message to be sent instead of the video animation
1173 pub input_message_content: Option<Box<InputMessageContent>>,
1174}
1175
1176/// Represents a link to a page containing an embedded video player or a
1177/// video file. By default, this video file will be sent by the user with an
1178/// optional caption. Alternatively, you can use input_message_content to
1179/// send a message with the specified content instead of the video.
1180#[derive(Serialize, Deserialize, Debug, Clone)]
1181pub struct InlineQueryResultVideo {
1182 /// Type of the result, must be video
1183 #[serde(rename = "type")]
1184 pub type_tl: String,
1185
1186 /// Unique identifier for this result, 1-64 bytes
1187 pub id: String,
1188
1189 /// A valid URL for the embedded video player or video file
1190 pub video_url: String,
1191
1192 /// Mime type of the content of video url, “text/html” or “video/mp4”
1193 pub mime_type: String,
1194
1195 /// URL of the thumbnail (jpeg only) for the video
1196 pub thumb_url: String,
1197
1198 /// Title for the result
1199 pub title: String,
1200
1201 /// Caption of the video to be sent, 0-200 characters
1202 pub caption: Option<String>,
1203
1204 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1205 /// fixed-width text or inline URLs in the media caption.
1206 /// See https://core.telegram.org/bots/api#markdown-style
1207 /// See https://core.telegram.org/bots/api#html-style
1208 /// See https://core.telegram.org/bots/api#formatting-options
1209 pub parse_mode: Option<String>,
1210
1211 /// Video width
1212 pub video_width: Option<i64>,
1213
1214 /// Video height
1215 pub video_height: Option<i64>,
1216
1217 /// Video duration in seconds
1218 pub video_duration: Option<i64>,
1219
1220 /// Short description of the result
1221 pub description: Option<String>,
1222
1223 /// Inline keyboard attached to the message
1224 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1225 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1226
1227 /// Content of the message to be sent instead of the video. This field is
1228 /// required if InlineQueryResultVideo is used to send an HTML-page as a
1229 /// result (e.g., a YouTube video).
1230 pub input_message_content: Option<Box<InputMessageContent>>,
1231}
1232
1233/// Represents a link to an mp3 audio file. By default, this audio file will
1234/// be sent by the user. Alternatively, you can use input_message_content to
1235/// send a message with the specified content instead of the audio.
1236#[derive(Serialize, Deserialize, Debug, Clone)]
1237pub struct InlineQueryResultAudio {
1238 /// Type of the result, must be audio
1239 #[serde(rename = "type")]
1240 pub type_tl: String,
1241
1242 /// Unique identifier for this result, 1-64 bytes
1243 pub id: String,
1244
1245 /// A valid URL for the audio file
1246 pub audio_url: String,
1247
1248 /// Title
1249 pub title: String,
1250
1251 /// Caption, 0-200 characters
1252 pub caption: Option<String>,
1253
1254 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1255 /// fixed-width text or inline URLs in the media caption.
1256 /// See https://core.telegram.org/bots/api#markdown-style
1257 /// See https://core.telegram.org/bots/api#html-style
1258 /// See https://core.telegram.org/bots/api#formatting-options
1259 pub parse_mode: Option<String>,
1260
1261 /// Performer
1262 pub performer: Option<String>,
1263
1264 /// Audio duration in seconds
1265 pub audio_duration: Option<i64>,
1266
1267 /// Inline keyboard attached to the message
1268 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1269 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1270
1271 /// Content of the message to be sent instead of the audio
1272 pub input_message_content: Option<Box<InputMessageContent>>,
1273}
1274
1275/// Represents a link to a voice recording in an .ogg container encoded with
1276/// OPUS. By default, this voice recording will be sent by the user.
1277/// Alternatively, you can use input_message_content to send a message with
1278/// the specified content instead of the the voice message.
1279#[derive(Serialize, Deserialize, Debug, Clone)]
1280pub struct InlineQueryResultVoice {
1281 /// Type of the result, must be voice
1282 #[serde(rename = "type")]
1283 pub type_tl: String,
1284
1285 /// Unique identifier for this result, 1-64 bytes
1286 pub id: String,
1287
1288 /// A valid URL for the voice recording
1289 pub voice_url: String,
1290
1291 /// Recording title
1292 pub title: String,
1293
1294 /// Caption, 0-200 characters
1295 pub caption: Option<String>,
1296
1297 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1298 /// fixed-width text or inline URLs in the media caption.
1299 /// See https://core.telegram.org/bots/api#markdown-style
1300 /// See https://core.telegram.org/bots/api#html-style
1301 /// See https://core.telegram.org/bots/api#formatting-options
1302 pub parse_mode: Option<String>,
1303
1304 /// Recording duration in seconds
1305 pub voice_duration: Option<i64>,
1306
1307 /// Inline keyboard attached to the message
1308 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1309 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1310
1311 /// Content of the message to be sent instead of the voice recording
1312 pub input_message_content: Option<Box<InputMessageContent>>,
1313}
1314
1315/// Represents a link to a file. By default, this file will be sent by the
1316/// user with an optional caption. Alternatively, you can use
1317/// input_message_content to send a message with the specified content
1318/// instead of the file. Currently, only .PDF and .ZIP files can be sent
1319/// using this method.
1320#[derive(Serialize, Deserialize, Debug, Clone)]
1321pub struct InlineQueryResultDocument {
1322 /// Type of the result, must be document
1323 #[serde(rename = "type")]
1324 pub type_tl: String,
1325
1326 /// Unique identifier for this result, 1-64 bytes
1327 pub id: String,
1328
1329 /// Title for the result
1330 pub title: String,
1331
1332 /// Caption of the document to be sent, 0-200 characters
1333 pub caption: Option<String>,
1334
1335 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1336 /// fixed-width text or inline URLs in the media caption.
1337 /// See https://core.telegram.org/bots/api#markdown-style
1338 /// See https://core.telegram.org/bots/api#html-style
1339 /// See https://core.telegram.org/bots/api#formatting-options
1340 pub parse_mode: Option<String>,
1341
1342 /// A valid URL for the file
1343 pub document_url: String,
1344
1345 /// Mime type of the content of the file, either “application/pdf” or “application/zip”
1346 pub mime_type: String,
1347
1348 /// Short description of the result
1349 pub description: Option<String>,
1350
1351 /// Inline keyboard attached to the message
1352 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1353
1354 /// Content of the message to be sent instead of the file
1355 pub input_message_content: Option<Box<InputMessageContent>>,
1356
1357 /// URL of the thumbnail (jpeg only) for the file
1358 pub thumb_url: Option<String>,
1359
1360 /// Thumbnail width
1361 pub thumb_width: Option<i64>,
1362
1363 /// Thumbnail height
1364 pub thumb_height: Option<i64>,
1365}
1366
1367/// Represents a location on a map. By default, the location will be sent by
1368/// the user. Alternatively, you can use input_message_content to send a
1369/// message with the specified content instead of the location.
1370#[derive(Serialize, Deserialize, Debug, Clone)]
1371pub struct InlineQueryResultLocation {
1372 /// Type of the result, must be location
1373 #[serde(rename = "type")]
1374 pub type_tl: String,
1375
1376 /// Unique identifier for this result, 1-64 Bytes
1377 pub id: String,
1378
1379 /// Location latitude in degrees
1380 pub latitude: f64,
1381
1382 /// Location longitude in degrees
1383 pub longitude: f64,
1384
1385 /// Location title
1386 pub title: String,
1387
1388 /// Period in seconds for which the location can be updated, should be
1389 /// between 60 and 86400.
1390 pub live_period: Option<i64>,
1391
1392 /// Inline keyboard attached to the message
1393 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1394 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1395
1396 /// Content of the message to be sent instead of the location
1397 pub input_message_content: Option<Box<InputMessageContent>>,
1398
1399 /// Url of the thumbnail for the result
1400 pub thumb_url: Option<String>,
1401
1402 /// Thumbnail width
1403 pub thumb_width: Option<i64>,
1404
1405 /// Thumbnail height
1406 pub thumb_height: Option<i64>,
1407}
1408
1409/// Represents a venue. By default, the venue will be sent by the user.
1410/// Alternatively, you can use input_message_content to send a message with
1411/// the specified content instead of the venue.
1412#[derive(Serialize, Deserialize, Debug, Clone)]
1413pub struct InlineQueryResultVenue {
1414 /// Type of the result, must be venue
1415 #[serde(rename = "type")]
1416 pub type_tl: String,
1417
1418 /// Unique identifier for this result, 1-64 Bytes
1419 pub id: String,
1420
1421 /// Latitude of the venue location in degrees
1422 pub latitude: f64,
1423
1424 /// Longitude of the venue location in degrees
1425 pub longitude: f64,
1426
1427 /// Title of the venue
1428 pub title: String,
1429
1430 /// Address of the venue
1431 pub address: String,
1432
1433 /// Foursquare identifier of the venue if known
1434 pub foursquare_id: Option<String>,
1435
1436 /// Inline keyboard attached to the message
1437 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1438 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1439
1440 /// Content of the message to be sent instead of the venue
1441 pub input_message_content: Option<Box<InputMessageContent>>,
1442
1443 /// Url of the thumbnail for the result
1444 pub thumb_url: Option<String>,
1445
1446 /// Thumbnail width
1447 pub thumb_width: Option<i64>,
1448
1449 /// Thumbnail height
1450 pub thumb_height: Option<i64>,
1451}
1452
1453/// Represents a contact with a phone number. By default, this contact will
1454/// be sent by the user. Alternatively, you can use input_message_content to
1455/// send a message with the specified content instead of the contact.
1456#[derive(Serialize, Deserialize, Debug, Clone)]
1457pub struct InlineQueryResultContact {
1458 /// Type of the result, must be contact
1459 #[serde(rename = "type")]
1460 pub type_tl: String,
1461
1462 /// Unique identifier for this result, 1-64 Bytes
1463 pub id: String,
1464
1465 /// Contact's phone number
1466 pub phone_number: String,
1467
1468 /// Contact's first name
1469 pub first_name: String,
1470
1471 /// Contact's last name
1472 pub last_name: Option<String>,
1473
1474 /// Inline keyboard attached to the message
1475 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1476 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1477
1478 /// Content of the message to be sent instead of the contact
1479 pub input_message_content: Option<Box<InputMessageContent>>,
1480
1481 /// Url of the thumbnail for the result
1482 pub thumb_url: Option<String>,
1483
1484 /// Thumbnail width
1485 pub thumb_width: Option<i64>,
1486
1487 /// Thumbnail height
1488 pub thumb_height: Option<i64>,
1489}
1490
1491/// Represents a Game.
1492/// See https://core.telegram.org/bots/api#games
1493#[derive(Serialize, Deserialize, Debug, Clone)]
1494pub struct InlineQueryResultGame {
1495 /// Type of the result, must be game
1496 #[serde(rename = "type")]
1497 pub type_tl: String,
1498
1499 /// Unique identifier for this result, 1-64 bytes
1500 pub id: String,
1501
1502 /// Short name of the game
1503 pub game_short_name: String,
1504
1505 /// Inline keyboard attached to the message
1506 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1507 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1508}
1509
1510/// Represents a link to a photo stored on the Telegram servers. By default,
1511/// this photo will be sent by the user with an optional caption.
1512/// Alternatively, you can use input_message_content to send a message with
1513/// the specified content instead of the photo.
1514#[derive(Serialize, Deserialize, Debug, Clone)]
1515pub struct InlineQueryResultCachedPhoto {
1516 /// Type of the result, must be photo
1517 #[serde(rename = "type")]
1518 pub type_tl: String,
1519
1520 /// Unique identifier for this result, 1-64 bytes
1521 pub id: String,
1522
1523 /// A valid file identifier of the photo
1524 pub photo_file_id: String,
1525
1526 /// Title for the result
1527 pub title: Option<String>,
1528
1529 /// Short description of the result
1530 pub description: Option<String>,
1531
1532 /// Caption of the photo to be sent, 0-200 characters
1533 pub caption: Option<String>,
1534
1535 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1536 /// fixed-width text or inline URLs in the media caption.
1537 /// See https://core.telegram.org/bots/api#markdown-style
1538 /// See https://core.telegram.org/bots/api#html-style
1539 /// See https://core.telegram.org/bots/api#formatting-options
1540 pub parse_mode: Option<String>,
1541
1542 /// Inline keyboard attached to the message
1543 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1544 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1545
1546 /// Content of the message to be sent instead of the photo
1547 pub input_message_content: Option<Box<InputMessageContent>>,
1548}
1549
1550/// Represents a link to an animated GIF file stored on the Telegram
1551/// servers. By default, this animated GIF file will be sent by the user
1552/// with an optional caption. Alternatively, you can use
1553/// input_message_content to send a message with specified content instead
1554/// of the animation.
1555#[derive(Serialize, Deserialize, Debug, Clone)]
1556pub struct InlineQueryResultCachedGif {
1557 /// Type of the result, must be gif
1558 #[serde(rename = "type")]
1559 pub type_tl: String,
1560
1561 /// Unique identifier for this result, 1-64 bytes
1562 pub id: String,
1563
1564 /// A valid file identifier for the GIF file
1565 pub gif_file_id: String,
1566
1567 /// Title for the result
1568 pub title: Option<String>,
1569
1570 /// Caption of the GIF file to be sent, 0-200 characters
1571 pub caption: Option<String>,
1572
1573 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1574 /// fixed-width text or inline URLs in the media caption.
1575 /// See https://core.telegram.org/bots/api#markdown-style
1576 /// See https://core.telegram.org/bots/api#html-style
1577 /// See https://core.telegram.org/bots/api#formatting-options
1578 pub parse_mode: Option<String>,
1579
1580 /// Inline keyboard attached to the message
1581 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1582 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1583
1584 /// Content of the message to be sent instead of the GIF animation
1585 pub input_message_content: Option<Box<InputMessageContent>>,
1586}
1587
1588/// Represents a link to a video animation (H.264/MPEG-4 AVC video without
1589/// sound) stored on the Telegram servers. By default, this animated MPEG-4
1590/// file will be sent by the user with an optional caption. Alternatively,
1591/// you can use input_message_content to send a message with the specified
1592/// content instead of the animation.
1593#[derive(Serialize, Deserialize, Debug, Clone)]
1594pub struct InlineQueryResultCachedMpeg4Gif {
1595 /// Type of the result, must be mpeg4_gif
1596 #[serde(rename = "type")]
1597 pub type_tl: String,
1598
1599 /// Unique identifier for this result, 1-64 bytes
1600 pub id: String,
1601
1602 /// A valid file identifier for the MP4 file
1603 pub mpeg4_file_id: String,
1604
1605 /// Title for the result
1606 pub title: Option<String>,
1607
1608 /// Caption of the MPEG-4 file to be sent, 0-200 characters
1609 pub caption: Option<String>,
1610
1611 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1612 /// fixed-width text or inline URLs in the media caption.
1613 /// See https://core.telegram.org/bots/api#markdown-style
1614 /// See https://core.telegram.org/bots/api#html-style
1615 /// See https://core.telegram.org/bots/api#formatting-options
1616 pub parse_mode: Option<String>,
1617
1618 /// Inline keyboard attached to the message
1619 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1620 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1621
1622 /// Content of the message to be sent instead of the video animation
1623 pub input_message_content: Option<Box<InputMessageContent>>,
1624}
1625
1626/// Represents a link to a sticker stored on the Telegram servers. By
1627/// default, this sticker will be sent by the user. Alternatively, you can
1628/// use input_message_content to send a message with the specified content
1629/// instead of the sticker.
1630#[derive(Serialize, Deserialize, Debug, Clone)]
1631pub struct InlineQueryResultCachedSticker {
1632 /// Type of the result, must be sticker
1633 #[serde(rename = "type")]
1634 pub type_tl: String,
1635
1636 /// Unique identifier for this result, 1-64 bytes
1637 pub id: String,
1638
1639 /// A valid file identifier of the sticker
1640 pub sticker_file_id: String,
1641
1642 /// Inline keyboard attached to the message
1643 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1644 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1645
1646 /// Content of the message to be sent instead of the sticker
1647 pub input_message_content: Option<Box<InputMessageContent>>,
1648}
1649
1650/// Represents a link to a file stored on the Telegram servers. By default,
1651/// this file will be sent by the user with an optional caption.
1652/// Alternatively, you can use input_message_content to send a message with
1653/// the specified content instead of the file.
1654#[derive(Serialize, Deserialize, Debug, Clone)]
1655pub struct InlineQueryResultCachedDocument {
1656 /// Type of the result, must be document
1657 #[serde(rename = "type")]
1658 pub type_tl: String,
1659
1660 /// Unique identifier for this result, 1-64 bytes
1661 pub id: String,
1662
1663 /// Title for the result
1664 pub title: String,
1665
1666 /// A valid file identifier for the file
1667 pub document_file_id: String,
1668
1669 /// Short description of the result
1670 pub description: Option<String>,
1671
1672 /// Caption of the document to be sent, 0-200 characters
1673 pub caption: Option<String>,
1674
1675 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1676 /// fixed-width text or inline URLs in the media caption.
1677 /// See https://core.telegram.org/bots/api#markdown-style
1678 /// See https://core.telegram.org/bots/api#html-style
1679 /// See https://core.telegram.org/bots/api#formatting-options
1680 pub parse_mode: Option<String>,
1681
1682 /// Inline keyboard attached to the message
1683 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1684 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1685
1686 /// Content of the message to be sent instead of the file
1687 pub input_message_content: Option<Box<InputMessageContent>>,
1688}
1689
1690/// Represents a link to a video file stored on the Telegram servers. By
1691/// default, this video file will be sent by the user with an optional
1692/// caption. Alternatively, you can use input_message_content to send a
1693/// message with the specified content instead of the video.
1694#[derive(Serialize, Deserialize, Debug, Clone)]
1695pub struct InlineQueryResultCachedVideo {
1696 /// Type of the result, must be video
1697 #[serde(rename = "type")]
1698 pub type_tl: String,
1699
1700 /// Unique identifier for this result, 1-64 bytes
1701 pub id: String,
1702
1703 /// A valid file identifier for the video file
1704 pub video_file_id: String,
1705
1706 /// Title for the result
1707 pub title: String,
1708
1709 /// Short description of the result
1710 pub description: Option<String>,
1711
1712 /// Caption of the video to be sent, 0-200 characters
1713 pub caption: Option<String>,
1714
1715 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1716 /// fixed-width text or inline URLs in the media caption.
1717 /// See https://core.telegram.org/bots/api#markdown-style
1718 /// See https://core.telegram.org/bots/api#html-style
1719 /// See https://core.telegram.org/bots/api#formatting-options
1720 pub parse_mode: Option<String>,
1721
1722 /// Inline keyboard attached to the message
1723 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1724 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1725
1726 /// Content of the message to be sent instead of the video
1727 pub input_message_content: Option<Box<InputMessageContent>>,
1728}
1729
1730/// Represents a link to a voice message stored on the Telegram servers. By
1731/// default, this voice message will be sent by the user. Alternatively, you
1732/// can use input_message_content to send a message with the specified
1733/// content instead of the voice message.
1734#[derive(Serialize, Deserialize, Debug, Clone)]
1735pub struct InlineQueryResultCachedVoice {
1736 /// Type of the result, must be voice
1737 #[serde(rename = "type")]
1738 pub type_tl: String,
1739
1740 /// Unique identifier for this result, 1-64 bytes
1741 pub id: String,
1742
1743 /// A valid file identifier for the voice message
1744 pub voice_file_id: String,
1745
1746 /// Voice message title
1747 pub title: String,
1748
1749 /// Caption, 0-200 characters
1750 pub caption: Option<String>,
1751
1752 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1753 /// fixed-width text or inline URLs in the media caption.
1754 /// See https://core.telegram.org/bots/api#markdown-style
1755 /// See https://core.telegram.org/bots/api#html-style
1756 /// See https://core.telegram.org/bots/api#formatting-options
1757 pub parse_mode: Option<String>,
1758
1759 /// Inline keyboard attached to the message
1760 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1761 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1762
1763 /// Content of the message to be sent instead of the voice message
1764 pub input_message_content: Option<Box<InputMessageContent>>,
1765}
1766
1767/// Represents a link to an mp3 audio file stored on the Telegram servers.
1768/// By default, this audio file will be sent by the user. Alternatively, you
1769/// can use input_message_content to send a message with the specified
1770/// content instead of the audio.
1771#[derive(Serialize, Deserialize, Debug, Clone)]
1772pub struct InlineQueryResultCachedAudio {
1773 /// Type of the result, must be audio
1774 #[serde(rename = "type")]
1775 pub type_tl: String,
1776
1777 /// Unique identifier for this result, 1-64 bytes
1778 pub id: String,
1779
1780 /// A valid file identifier for the audio file
1781 pub audio_file_id: String,
1782
1783 /// Caption, 0-200 characters
1784 pub caption: Option<String>,
1785
1786 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1787 /// fixed-width text or inline URLs in the media caption.
1788 /// See https://core.telegram.org/bots/api#markdown-style
1789 /// See https://core.telegram.org/bots/api#html-style
1790 /// See https://core.telegram.org/bots/api#formatting-options
1791 pub parse_mode: Option<String>,
1792
1793 /// Inline keyboard attached to the message
1794 /// See https://core.telegram.org/bots/api/bots#inline-keyboards-and-on-the-fly-updating
1795 pub reply_markup: Option<Box<InlineKeyboardMarkup>>,
1796
1797 /// Content of the message to be sent instead of the audio
1798 pub input_message_content: Option<Box<InputMessageContent>>,
1799}
1800
1801/// Represents the content of a text message to be sent as the result of an
1802/// inline query.
1803/// See https://core.telegram.org/bots/api#inputmessagecontent
1804#[derive(Serialize, Deserialize, Debug, Clone)]
1805pub struct InputTextMessageContent {
1806 /// Text of the message to be sent, 1-4096 characters
1807 pub message_text: String,
1808
1809 /// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
1810 /// fixed-width text or inline URLs in your bot's message.
1811 /// See https://core.telegram.org/bots/api#markdown-style
1812 /// See https://core.telegram.org/bots/api#html-style
1813 /// See https://core.telegram.org/bots/api#formatting-options
1814 pub parse_mode: Option<String>,
1815
1816 /// Disables link previews for links in the sent message
1817 pub disable_web_page_preview: Option<bool>,
1818}
1819
1820/// Represents the content of a location message to be sent as the result of
1821/// an inline query.
1822/// See https://core.telegram.org/bots/api#inputmessagecontent
1823#[derive(Serialize, Deserialize, Debug, Clone)]
1824pub struct InputLocationMessageContent {
1825 /// Latitude of the location in degrees
1826 pub latitude: f64,
1827
1828 /// Longitude of the location in degrees
1829 pub longitude: f64,
1830
1831 /// Period in seconds for which the location can be updated, should be
1832 /// between 60 and 86400.
1833 pub live_period: Option<i64>,
1834}
1835
1836/// Represents the content of a venue message to be sent as the result of an
1837/// inline query.
1838/// See https://core.telegram.org/bots/api#inputmessagecontent
1839#[derive(Serialize, Deserialize, Debug, Clone)]
1840pub struct InputVenueMessageContent {
1841 /// Latitude of the venue in degrees
1842 pub latitude: f64,
1843
1844 /// Longitude of the venue in degrees
1845 pub longitude: f64,
1846
1847 /// Name of the venue
1848 pub title: String,
1849
1850 /// Address of the venue
1851 pub address: String,
1852
1853 /// Foursquare identifier of the venue, if known
1854 pub foursquare_id: Option<String>,
1855}
1856
1857/// Represents the content of a contact message to be sent as the result of
1858/// an inline query.
1859/// See https://core.telegram.org/bots/api#inputmessagecontent
1860#[derive(Serialize, Deserialize, Debug, Clone)]
1861pub struct InputContactMessageContent {
1862 /// Contact's phone number
1863 pub phone_number: String,
1864
1865 /// Contact's first name
1866 pub first_name: String,
1867
1868 /// Contact's last name
1869 pub last_name: Option<String>,
1870}
1871
1872/// Represents a result of an inline query that was chosen by the user and
1873/// sent to their chat partner.
1874/// See https://core.telegram.org/bots/api#inlinequeryresult
1875#[derive(Serialize, Deserialize, Debug, Clone)]
1876pub struct ChosenInlineResult {
1877 /// The unique identifier for the result that was chosen
1878 pub result_id: String,
1879
1880 /// The user that chose the result
1881 pub from: Box<User>,
1882
1883 /// Sender location, only for bots that require user location
1884 pub location: Option<Box<Location>>,
1885
1886 /// Identifier of the sent inline message. Available only if there is an
1887 /// inline keyboard attached to the message. Will be also received in
1888 /// callback queries and can be used to edit the message.
1889 /// See https://core.telegram.org/bots/api#inlinekeyboardmarkup
1890 /// See https://core.telegram.org/bots/api#callbackquery
1891 /// See https://core.telegram.org/bots/api#updating-messages
1892 pub inline_message_id: Option<String>,
1893
1894 /// The query that was used to obtain the result
1895 pub query: String,
1896}
1897
1898/// This object represents a portion of the price for goods or services.
1899#[derive(Serialize, Deserialize, Debug, Clone)]
1900pub struct LabeledPrice {
1901 /// Portion label
1902 pub label: String,
1903
1904 /// Price of the product in the smallest units of the currency (integer, not
1905 /// float/double). For example, for a price of US$ 1.45 pass amount = 145.
1906 /// See the exp parameter in currencies.json, it shows the number of digits
1907 /// past the decimal point for each currency (2 for the majority of currencies).
1908 /// See https://core.telegram.org/bots/api/bots/payments#supported-currencies
1909 /// See https://core.telegram.org/bots/payments/currencies.json
1910 pub amount: i64,
1911}
1912
1913/// This object contains basic information about an invoice.
1914#[derive(Serialize, Deserialize, Debug, Clone)]
1915pub struct Invoice {
1916 /// Product name
1917 pub title: String,
1918
1919 /// Product description
1920 pub description: String,
1921
1922 /// Unique bot deep-linking parameter that can be used to generate this invoice
1923 pub start_parameter: String,
1924
1925 /// Three-letter ISO 4217 currency code
1926 /// See https://core.telegram.org/bots/api/bots/payments#supported-currencies
1927 pub currency: String,
1928
1929 /// Total price in the smallest units of the currency (integer, not
1930 /// float/double). For example, for a price of US$ 1.45 pass amount = 145.
1931 /// See the exp parameter in currencies.json, it shows the number of digits
1932 /// past the decimal point for each currency (2 for the majority of currencies).
1933 /// See https://core.telegram.org/bots/payments/currencies.json
1934 pub total_amount: i64,
1935}
1936
1937/// This object represents a shipping address.
1938#[derive(Serialize, Deserialize, Debug, Clone)]
1939pub struct ShippingAddress {
1940 /// ISO 3166-1 alpha-2 country code
1941 pub country_code: String,
1942
1943 /// State, if applicable
1944 pub state: String,
1945
1946 /// City
1947 pub city: String,
1948
1949 /// First line for the address
1950 pub street_line1: String,
1951
1952 /// Second line for the address
1953 pub street_line2: String,
1954
1955 /// Address post code
1956 pub post_code: String,
1957}
1958
1959/// This object represents information about an order.
1960#[derive(Serialize, Deserialize, Debug, Clone)]
1961pub struct OrderInfo {
1962 /// User name
1963 pub name: Option<String>,
1964
1965 /// User's phone number
1966 pub phone_number: Option<String>,
1967
1968 /// User email
1969 pub email: Option<String>,
1970
1971 /// User shipping address
1972 pub shipping_address: Option<Box<ShippingAddress>>,
1973}
1974
1975/// This object represents one shipping option.
1976#[derive(Serialize, Deserialize, Debug, Clone)]
1977pub struct ShippingOption {
1978 /// Shipping option identifier
1979 pub id: String,
1980
1981 /// Option title
1982 pub title: String,
1983
1984 /// List of price portions
1985 pub prices: Vec<Box<LabeledPrice>>,
1986}
1987
1988/// This object contains basic information about a successful payment.
1989#[derive(Serialize, Deserialize, Debug, Clone)]
1990pub struct SuccessfulPayment {
1991 /// Three-letter ISO 4217 currency code
1992 /// See https://core.telegram.org/bots/api/bots/payments#supported-currencies
1993 pub currency: String,
1994
1995 /// Total price in the smallest units of the currency (integer, not
1996 /// float/double). For example, for a price of US$ 1.45 pass amount = 145.
1997 /// See the exp parameter in currencies.json, it shows the number of digits
1998 /// past the decimal point for each currency (2 for the majority of currencies).
1999 /// See https://core.telegram.org/bots/payments/currencies.json
2000 pub total_amount: i64,
2001
2002 /// Bot specified invoice payload
2003 pub invoice_payload: String,
2004
2005 /// Identifier of the shipping option chosen by the user
2006 pub shipping_option_id: Option<String>,
2007
2008 /// Order info provided by the user
2009 pub order_info: Option<Box<OrderInfo>>,
2010
2011 /// Telegram payment identifier
2012 pub telegram_payment_charge_id: String,
2013
2014 /// Provider payment identifier
2015 pub provider_payment_charge_id: String,
2016}
2017
2018/// This object contains information about an incoming shipping query.
2019#[derive(Serialize, Deserialize, Debug, Clone)]
2020pub struct ShippingQuery {
2021 /// Unique query identifier
2022 pub id: String,
2023
2024 /// User who sent the query
2025 pub from: Box<User>,
2026
2027 /// Bot specified invoice payload
2028 pub invoice_payload: String,
2029
2030 /// User specified shipping address
2031 pub shipping_address: Box<ShippingAddress>,
2032}
2033
2034/// This object contains information about an incoming pre-checkout query.
2035#[derive(Serialize, Deserialize, Debug, Clone)]
2036pub struct PreCheckoutQuery {
2037 /// Unique query identifier
2038 pub id: String,
2039
2040 /// User who sent the query
2041 pub from: Box<User>,
2042
2043 /// Three-letter ISO 4217 currency code
2044 /// See https://core.telegram.org/bots/api/bots/payments#supported-currencies
2045 pub currency: String,
2046
2047 /// Total price in the smallest units of the currency (integer, not
2048 /// float/double). For example, for a price of US$ 1.45 pass amount = 145.
2049 /// See the exp parameter in currencies.json, it shows the number of digits
2050 /// past the decimal point for each currency (2 for the majority of currencies).
2051 /// See https://core.telegram.org/bots/payments/currencies.json
2052 pub total_amount: i64,
2053
2054 /// Bot specified invoice payload
2055 pub invoice_payload: String,
2056
2057 /// Identifier of the shipping option chosen by the user
2058 pub shipping_option_id: Option<String>,
2059
2060 /// Order info provided by the user
2061 pub order_info: Option<Box<OrderInfo>>,
2062}
2063
2064/// This object represents a game. Use BotFather to create and edit games,
2065/// their short names will act as unique identifiers.
2066#[derive(Serialize, Deserialize, Debug, Clone)]
2067pub struct Game {
2068 /// Title of the game
2069 pub title: String,
2070
2071 /// Description of the game
2072 pub description: String,
2073
2074 /// Photo that will be displayed in the game message in chats.
2075 pub photo: Vec<Box<PhotoSize>>,
2076
2077 /// Brief description of the game or high scores included in the game
2078 /// message. Can be automatically edited to include current high scores for
2079 /// the game when the bot calls setGameScore, or manually edited using
2080 /// editMessageText. 0-4096 characters.
2081 /// See https://core.telegram.org/bots/api#setgamescore
2082 /// See https://core.telegram.org/bots/api#editmessagetext
2083 pub text: Option<String>,
2084
2085 /// Special entities that appear in text, such as usernames, URLs, bot
2086 /// commands, etc.
2087 pub text_entities: Option<Vec<Box<MessageEntity>>>,
2088
2089 /// Animation that will be displayed in the game message in chats. Upload
2090 /// via BotFather
2091 /// See https://t.me/botfather
2092 pub animation: Option<Box<Animation>>,
2093}
2094
2095/// You can provide an animation for your game so that it looks stylish in
2096/// chats (check out Lumberjack for an example). This object represents an
2097/// animation file to be displayed in the message containing a game.
2098/// See https://core.telegram.org/bots/api#game
2099/// See https://t.me/gamebot
2100/// See https://core.telegram.org/bots/api#games
2101#[derive(Serialize, Deserialize, Debug, Clone)]
2102pub struct Animation {
2103 /// Unique file identifier
2104 pub file_id: String,
2105
2106 /// Animation thumbnail as defined by sender
2107 pub thumb: Option<Box<PhotoSize>>,
2108
2109 /// Original animation filename as defined by sender
2110 pub file_name: Option<String>,
2111
2112 /// MIME type of the file as defined by sender
2113 pub mime_type: Option<String>,
2114
2115 /// File size
2116 pub file_size: Option<i64>,
2117}
2118
2119/// This object represents one row of the high scores table for a game.
2120#[derive(Serialize, Deserialize, Debug, Clone)]
2121pub struct GameHighScore {
2122 /// Position in high score table for the game
2123 pub position: i64,
2124
2125 /// User
2126 pub user: Box<User>,
2127
2128 /// Score
2129 pub score: i64,
2130}