telegram_bot2/models/
action.rs

1use crate::models::{
2    skip_ser_sf_opt, BotCommand, BotCommandScope, ChatAdministratorRights, ChatId, ChatPermissions, InlineKeyboardMarkup, InlineQueryResult, InputMedia, LabeledPrice, MenuButton, MessageEntity, PassportElementError, ReplyMarkup, SentFile,
3    ShippingOption,
4};
5use crate::{Builder, FileHolder};
6use serde::{Deserialize, Serialize};
7
8/// Use this method to send text messages. On success, the sent [`Message`][crate::models::Message] is returned.
9#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
10pub struct SendMessage {
11    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
12    pub(crate) chat_id: ChatId,
13    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub(crate) message_thread_id: Option<i64>,
16    /// Text of the message to be sent, 1-4096 characters after entities parsing
17    pub(crate) text: String,
18    /// Mode for parsing entities in the message text. See <a href="#formatting-options">formatting options</a> for more details.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub(crate) parse_mode: Option<String>,
21    /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of <em>parse_mode</em>
22    #[serde(skip_serializing_if = "Vec::is_empty")]
23    pub(crate) entities: Vec<MessageEntity>,
24    /// Disables link previews for links in this message
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub(crate) disable_web_page_preview: Option<bool>,
27    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub(crate) disable_notification: Option<bool>,
30    /// Protects the contents of the sent message from forwarding and saving
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub(crate) protect_content: Option<bool>,
33    /// If the message is a reply, ID of the original message
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub(crate) reply_to_message_id: Option<i64>,
36    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub(crate) allow_sending_without_reply: Option<bool>,
39    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub(crate) reply_markup: Option<ReplyMarkup>,
42}
43
44/// Use this method to forward messages of any kind. Service messages can&#39;t be forwarded. On success, the sent [`Message`][crate::models::Message] is returned.
45#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
46pub struct ForwardMessage {
47    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
48    pub(crate) chat_id: ChatId,
49    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
50    #[serde(skip_serializing_if = "Option::is_none")]
51    pub(crate) message_thread_id: Option<i64>,
52    /// Unique identifier for the chat where the original message was sent (or channel username in the format @channel|username)
53    pub(crate) from_chat_id: ChatId,
54    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub(crate) disable_notification: Option<bool>,
57    /// Protects the contents of the forwarded message from forwarding and saving
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub(crate) protect_content: Option<bool>,
60    /// Message identifier in the chat specified in <em>from_chat_id</em>
61    pub(crate) message_id: i64,
62}
63
64/// Use this method to copy messages of any kind. Service messages and invoice messages can&#39;t be copied. A quiz [`Poll`][crate::models::Poll] can be copied only if the value of the field <em>correct_option_id</em> is known to the bot. The method is analogous to the method [`forward_message`][crate::Bot::forward_message], but the copied message doesn&#39;t have a link to the original message. Returns the [`MessageId`][crate::models::MessageId]of the sent message on success.
65#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
66pub struct CopyMessage {
67    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
68    pub(crate) chat_id: ChatId,
69    /// Unique identifier for the chat where the original message was sent (or channel username in the format @channel|username)
70    pub(crate) from_chat_id: ChatId,
71    /// Message identifier in the chat specified in <em>from_chat_id</em>
72    pub(crate) message_id: i64,
73    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pub(crate) message_thread_id: Option<i64>,
76    /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
77    #[serde(skip_serializing_if = "Option::is_none")]
78    pub(crate) caption: Option<String>,
79    /// Mode for parsing entities in the new caption. See <a href="#formatting-options">formatting options</a> for more details.
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub(crate) parse_mode: Option<String>,
82    /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of <em>parse_mode</em>
83    #[serde(skip_serializing_if = "Vec::is_empty")]
84    pub(crate) caption_entities: Vec<MessageEntity>,
85    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
86    #[serde(skip_serializing_if = "Option::is_none")]
87    pub(crate) disable_notification: Option<bool>,
88    /// Protects the contents of the sent message from forwarding and saving
89    #[serde(skip_serializing_if = "Option::is_none")]
90    pub(crate) protect_content: Option<bool>,
91    /// If the message is a reply, ID of the original message
92    #[serde(skip_serializing_if = "Option::is_none")]
93    pub(crate) reply_to_message_id: Option<i64>,
94    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
95    #[serde(skip_serializing_if = "Option::is_none")]
96    pub(crate) allow_sending_without_reply: Option<bool>,
97    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
98    #[serde(skip_serializing_if = "Option::is_none")]
99    pub(crate) reply_markup: Option<ReplyMarkup>,
100}
101
102/// Use this method to send photos. On success, the sent [`Message`][crate::models::Message] is returned.
103#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
104pub struct SendPhoto {
105    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub(crate) message_thread_id: Option<i64>,
108    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
109    pub(crate) chat_id: ChatId,
110    /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo&#39;s width and height must not exceed 10000 in total. Width and height ratio must be at most 20. <a href="#sending-files">More information on Sending Files »</a>
111    #[serde(skip_serializing_if = "SentFile::is_upload")]
112    pub(crate) photo: SentFile,
113    /// Photo caption (may also be used when resending photos by <em>file_id</em>), 0-1024 characters after entities parsing
114    #[serde(skip_serializing_if = "Option::is_none")]
115    pub(crate) caption: Option<String>,
116    /// Mode for parsing entities in the photo caption. See <a href="#formatting-options">formatting options</a> for more details.
117    #[serde(skip_serializing_if = "Option::is_none")]
118    pub(crate) parse_mode: Option<String>,
119    /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
120    #[serde(skip_serializing_if = "Vec::is_empty")]
121    pub(crate) caption_entities: Vec<MessageEntity>,
122    /// Pass True if the photo needs to be covered with a spoiler animation
123    #[serde(skip_serializing_if = "Option::is_none")]
124    pub(crate) has_spoiler: Option<bool>,
125    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
126    #[serde(skip_serializing_if = "Option::is_none")]
127    pub(crate) disable_notification: Option<bool>,
128    /// Protects the contents of the sent message from forwarding and saving
129    #[serde(skip_serializing_if = "Option::is_none")]
130    pub(crate) protect_content: Option<bool>,
131    /// If the message is a reply, ID of the original message
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub(crate) reply_to_message_id: Option<i64>,
134    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
135    #[serde(skip_serializing_if = "Option::is_none")]
136    pub(crate) allow_sending_without_reply: Option<bool>,
137    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub(crate) reply_markup: Option<ReplyMarkup>,
140}
141
142/// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent [`Message`][crate::models::Message] is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.</p><p>For sending voice messages, use the [`send_invoice`][crate::Bot::send_invoice] method instead.
143#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
144pub struct SendAudio {
145    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
146    #[serde(skip_serializing_if = "Option::is_none")]
147    pub(crate) message_thread_id: Option<i64>,
148    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
149    pub(crate) chat_id: ChatId,
150    /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>
151    #[serde(skip_serializing_if = "SentFile::is_upload")]
152    pub(crate) audio: SentFile,
153    /// Audio caption, 0-1024 characters after entities parsing
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub(crate) caption: Option<String>,
156    /// Mode for parsing entities in the audio caption. See <a href="#formatting-options">formatting options</a> for more details.
157    #[serde(skip_serializing_if = "Option::is_none")]
158    pub(crate) parse_mode: Option<String>,
159    /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
160    #[serde(skip_serializing_if = "Vec::is_empty")]
161    pub(crate) caption_entities: Vec<MessageEntity>,
162    /// Duration of the audio in seconds
163    #[serde(skip_serializing_if = "Option::is_none")]
164    pub(crate) duration: Option<i64>,
165    /// Performer
166    #[serde(skip_serializing_if = "Option::is_none")]
167    pub(crate) performer: Option<String>,
168    /// Track name
169    #[serde(skip_serializing_if = "Option::is_none")]
170    pub(crate) title: Option<String>,
171    /// 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&#39;s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can&#39;t be reused and can be only uploaded as a new file, so you can pass “attach://&lt;file_attach_name&gt;” if the thumbnail was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href="#sending-files">More information on Sending Files »</a>
172    #[serde(skip_serializing_if = "skip_ser_sf_opt")]
173    pub(crate) thumb: Option<SentFile>,
174    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
175    #[serde(skip_serializing_if = "Option::is_none")]
176    pub(crate) disable_notification: Option<bool>,
177    /// Protects the contents of the sent message from forwarding and saving
178    #[serde(skip_serializing_if = "Option::is_none")]
179    pub(crate) protect_content: Option<bool>,
180    /// If the message is a reply, ID of the original message
181    #[serde(skip_serializing_if = "Option::is_none")]
182    pub(crate) reply_to_message_id: Option<i64>,
183    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
184    #[serde(skip_serializing_if = "Option::is_none")]
185    pub(crate) allow_sending_without_reply: Option<bool>,
186    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
187    #[serde(skip_serializing_if = "Option::is_none")]
188    pub(crate) reply_markup: Option<ReplyMarkup>,
189}
190
191/// Use this method to send general files. On success, the sent [`Message`][crate::models::Message] is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
192#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
193pub struct SendDocument {
194    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub(crate) message_thread_id: Option<i64>,
197    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
198    pub(crate) chat_id: ChatId,
199    /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>
200    #[serde(skip_serializing_if = "SentFile::is_upload")]
201    pub(crate) document: SentFile,
202    /// 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&#39;s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can&#39;t be reused and can be only uploaded as a new file, so you can pass “attach://&lt;file_attach_name&gt;” if the thumbnail was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href="#sending-files">More information on Sending Files »</a>
203    #[serde(skip_serializing_if = "skip_ser_sf_opt")]
204    pub(crate) thumb: Option<SentFile>,
205    /// Document caption (may also be used when resending documents by <em>file_id</em>), 0-1024 characters after entities parsing
206    #[serde(skip_serializing_if = "Option::is_none")]
207    pub(crate) caption: Option<String>,
208    /// Mode for parsing entities in the document caption. See <a href="#formatting-options">formatting options</a> for more details.
209    #[serde(skip_serializing_if = "Option::is_none")]
210    pub(crate) parse_mode: Option<String>,
211    /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
212    #[serde(skip_serializing_if = "Vec::is_empty")]
213    pub(crate) caption_entities: Vec<MessageEntity>,
214    /// Disables automatic server-side content type detection for files uploaded using multipart/form-data
215    #[serde(skip_serializing_if = "Option::is_none")]
216    pub(crate) disable_content_type_detection: Option<bool>,
217    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
218    #[serde(skip_serializing_if = "Option::is_none")]
219    pub(crate) disable_notification: Option<bool>,
220    /// Protects the contents of the sent message from forwarding and saving
221    #[serde(skip_serializing_if = "Option::is_none")]
222    pub(crate) protect_content: Option<bool>,
223    /// If the message is a reply, ID of the original message
224    #[serde(skip_serializing_if = "Option::is_none")]
225    pub(crate) reply_to_message_id: Option<i64>,
226    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
227    #[serde(skip_serializing_if = "Option::is_none")]
228    pub(crate) allow_sending_without_reply: Option<bool>,
229    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
230    #[serde(skip_serializing_if = "Option::is_none")]
231    pub(crate) reply_markup: Option<ReplyMarkup>,
232}
233
234/// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as [`Document`][crate::models::Document]). On success, the sent [`Message`][crate::models::Message] is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
235#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
236pub struct SendVideo {
237    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
238    #[serde(skip_serializing_if = "Option::is_none")]
239    pub(crate) message_thread_id: Option<i64>,
240    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
241    pub(crate) chat_id: ChatId,
242    /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>
243    #[serde(skip_serializing_if = "SentFile::is_upload")]
244    pub(crate) video: SentFile,
245    /// Duration of sent video in seconds
246    #[serde(skip_serializing_if = "Option::is_none")]
247    pub(crate) duration: Option<i64>,
248    /// Video width
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub(crate) width: Option<i64>,
251    /// Video height
252    #[serde(skip_serializing_if = "Option::is_none")]
253    pub(crate) height: Option<i64>,
254    /// 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&#39;s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can&#39;t be reused and can be only uploaded as a new file, so you can pass “attach://&lt;file_attach_name&gt;” if the thumbnail was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href="#sending-files">More information on Sending Files »</a>
255    #[serde(skip_serializing_if = "skip_ser_sf_opt")]
256    pub(crate) thumb: Option<SentFile>,
257    /// Video caption (may also be used when resending videos by <em>file_id</em>), 0-1024 characters after entities parsing
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub(crate) caption: Option<String>,
260    /// Mode for parsing entities in the video caption. See <a href="#formatting-options">formatting options</a> for more details.
261    #[serde(skip_serializing_if = "Option::is_none")]
262    pub(crate) parse_mode: Option<String>,
263    /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
264    #[serde(skip_serializing_if = "Vec::is_empty")]
265    pub(crate) caption_entities: Vec<MessageEntity>,
266    /// Pass True if the video needs to be covered with a spoiler animation
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub(crate) has_spoiler: Option<bool>,
269    /// Pass <em>True</em> if the uploaded video is suitable for streaming
270    #[serde(skip_serializing_if = "Option::is_none")]
271    pub(crate) supports_streaming: Option<bool>,
272    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
273    #[serde(skip_serializing_if = "Option::is_none")]
274    pub(crate) disable_notification: Option<bool>,
275    /// Protects the contents of the sent message from forwarding and saving
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub(crate) protect_content: Option<bool>,
278    /// If the message is a reply, ID of the original message
279    #[serde(skip_serializing_if = "Option::is_none")]
280    pub(crate) reply_to_message_id: Option<i64>,
281    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub(crate) allow_sending_without_reply: Option<bool>,
284    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
285    #[serde(skip_serializing_if = "Option::is_none")]
286    pub(crate) reply_markup: Option<ReplyMarkup>,
287}
288
289/// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent [`Message`][crate::models::Message] is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
290#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
291pub struct SendAnimation {
292    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub(crate) message_thread_id: Option<i64>,
295    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
296    pub(crate) chat_id: ChatId,
297    /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>
298    #[serde(skip_serializing_if = "SentFile::is_upload")]
299    pub(crate) animation: SentFile,
300    /// Duration of sent animation in seconds
301    #[serde(skip_serializing_if = "Option::is_none")]
302    pub(crate) duration: Option<i64>,
303    /// Animation width
304    #[serde(skip_serializing_if = "Option::is_none")]
305    pub(crate) width: Option<i64>,
306    /// Animation height
307    #[serde(skip_serializing_if = "Option::is_none")]
308    pub(crate) height: Option<i64>,
309    /// 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&#39;s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can&#39;t be reused and can be only uploaded as a new file, so you can pass “attach://&lt;file_attach_name&gt;” if the thumbnail was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href="#sending-files">More information on Sending Files »</a>
310    #[serde(skip_serializing_if = "skip_ser_sf_opt")]
311    pub(crate) thumb: Option<SentFile>,
312    /// Animation caption (may also be used when resending animation by <em>file_id</em>), 0-1024 characters after entities parsing
313    #[serde(skip_serializing_if = "Option::is_none")]
314    pub(crate) caption: Option<String>,
315    /// Mode for parsing entities in the animation caption. See <a href="#formatting-options">formatting options</a> for more details.
316    #[serde(skip_serializing_if = "Option::is_none")]
317    pub(crate) parse_mode: Option<String>,
318    /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
319    #[serde(skip_serializing_if = "Vec::is_empty")]
320    pub(crate) caption_entities: Vec<MessageEntity>,
321    /// Pass True if the animation needs to be covered with a spoiler animation
322    #[serde(skip_serializing_if = "Option::is_none")]
323    pub(crate) has_spoiler: Option<bool>,
324    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
325    #[serde(skip_serializing_if = "Option::is_none")]
326    pub(crate) disable_notification: Option<bool>,
327    /// Protects the contents of the sent message from forwarding and saving
328    #[serde(skip_serializing_if = "Option::is_none")]
329    pub(crate) protect_content: Option<bool>,
330    /// If the message is a reply, ID of the original message
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub(crate) reply_to_message_id: Option<i64>,
333    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
334    #[serde(skip_serializing_if = "Option::is_none")]
335    pub(crate) allow_sending_without_reply: Option<bool>,
336    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
337    #[serde(skip_serializing_if = "Option::is_none")]
338    pub(crate) reply_markup: Option<ReplyMarkup>,
339}
340
341/// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as [`Audio`][crate::models::Audio] or [`Document`][crate::models::Document]). On success, the sent [`Message`][crate::models::Message] is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
342#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
343pub struct SendVoice {
344    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
345    #[serde(skip_serializing_if = "Option::is_none")]
346    pub(crate) message_thread_id: Option<i64>,
347    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
348    pub(crate) chat_id: ChatId,
349    /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>
350    #[serde(skip_serializing_if = "SentFile::is_upload")]
351    pub(crate) voice: SentFile,
352    /// Voice message caption, 0-1024 characters after entities parsing
353    #[serde(skip_serializing_if = "Option::is_none")]
354    pub(crate) caption: Option<String>,
355    /// Mode for parsing entities in the voice message caption. See <a href="#formatting-options">formatting options</a> for more details.
356    #[serde(skip_serializing_if = "Option::is_none")]
357    pub(crate) parse_mode: Option<String>,
358    /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
359    #[serde(skip_serializing_if = "Vec::is_empty")]
360    pub(crate) caption_entities: Vec<MessageEntity>,
361    /// Duration of the voice message in seconds
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub(crate) duration: Option<i64>,
364    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
365    #[serde(skip_serializing_if = "Option::is_none")]
366    pub(crate) disable_notification: Option<bool>,
367    /// Protects the contents of the sent message from forwarding and saving
368    #[serde(skip_serializing_if = "Option::is_none")]
369    pub(crate) protect_content: Option<bool>,
370    /// If the message is a reply, ID of the original message
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub(crate) reply_to_message_id: Option<i64>,
373    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
374    #[serde(skip_serializing_if = "Option::is_none")]
375    pub(crate) allow_sending_without_reply: Option<bool>,
376    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
377    #[serde(skip_serializing_if = "Option::is_none")]
378    pub(crate) reply_markup: Option<ReplyMarkup>,
379}
380
381/// As of [v.4.0](https://telegram.org/blog/video-messages-and-telescope), Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent [`Message`][crate::models::Message] is returned.
382#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
383pub struct SendVideoNote {
384    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
385    #[serde(skip_serializing_if = "Option::is_none")]
386    pub(crate) message_thread_id: Option<i64>,
387    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
388    pub(crate) chat_id: ChatId,
389    /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Sending video notes by a URL is currently unsupported
390    #[serde(skip_serializing_if = "SentFile::is_upload")]
391    pub(crate) video_note: SentFile,
392    /// Duration of sent video in seconds
393    #[serde(skip_serializing_if = "Option::is_none")]
394    pub(crate) duration: Option<i64>,
395    /// Video width and height, i.e. diameter of the video message
396    #[serde(skip_serializing_if = "Option::is_none")]
397    pub(crate) length: Option<i64>,
398    /// 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&#39;s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can&#39;t be reused and can be only uploaded as a new file, so you can pass “attach://&lt;file_attach_name&gt;” if the thumbnail was uploaded using multipart/form-data under &lt;file_attach_name&gt;. <a href="#sending-files">More information on Sending Files »</a>
399    #[serde(skip_serializing_if = "skip_ser_sf_opt")]
400    pub(crate) thumb: Option<SentFile>,
401    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
402    #[serde(skip_serializing_if = "Option::is_none")]
403    pub(crate) disable_notification: Option<bool>,
404    /// Protects the contents of the sent message from forwarding and saving
405    #[serde(skip_serializing_if = "Option::is_none")]
406    pub(crate) protect_content: Option<bool>,
407    /// If the message is a reply, ID of the original message
408    #[serde(skip_serializing_if = "Option::is_none")]
409    pub(crate) reply_to_message_id: Option<i64>,
410    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
411    #[serde(skip_serializing_if = "Option::is_none")]
412    pub(crate) allow_sending_without_reply: Option<bool>,
413    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
414    #[serde(skip_serializing_if = "Option::is_none")]
415    pub(crate) reply_markup: Option<ReplyMarkup>,
416}
417
418/// Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of [`Message`][crate::models::Message] that were sent is returned.
419#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
420pub struct SendMediaGroup {
421    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
422    #[serde(skip_serializing_if = "Option::is_none")]
423    pub(crate) message_thread_id: Option<i64>,
424    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
425    pub(crate) chat_id: ChatId,
426    /// A JSON-serialized array describing messages to be sent, must include 2-10 items
427    #[serde(skip_serializing_if = "Vec::is_empty")]
428    pub(crate) media: Vec<InputMedia>,
429    /// Sends messages <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
430    #[serde(skip_serializing_if = "Option::is_none")]
431    pub(crate) disable_notification: Option<bool>,
432    /// Protects the contents of the sent messages from forwarding and saving
433    #[serde(skip_serializing_if = "Option::is_none")]
434    pub(crate) protect_content: Option<bool>,
435    /// If the messages are a reply, ID of the original message
436    #[serde(skip_serializing_if = "Option::is_none")]
437    pub(crate) reply_to_message_id: Option<i64>,
438    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
439    #[serde(skip_serializing_if = "Option::is_none")]
440    pub(crate) allow_sending_without_reply: Option<bool>,
441}
442
443/// Use this method to send point on the map. On success, the sent [`Message`][crate::models::Message] is returned.
444#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
445pub struct SendLocation {
446    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub(crate) message_thread_id: Option<i64>,
449    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
450    pub(crate) chat_id: ChatId,
451    /// Latitude of the location
452    pub(crate) latitude: f64,
453    /// Longitude of the location
454    pub(crate) longitude: f64,
455    /// The radius of uncertainty for the location, measured in meters; 0-1500
456    #[serde(skip_serializing_if = "Option::is_none")]
457    pub(crate) horizontal_accuracy: Option<f64>,
458    /// Period in seconds for which the location will be updated (see <a href="https://telegram.org/blog/live-locations">Live Locations</a>, should be between 60 and 86400.
459    #[serde(skip_serializing_if = "Option::is_none")]
460    pub(crate) live_period: Option<i64>,
461    /// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
462    #[serde(skip_serializing_if = "Option::is_none")]
463    pub(crate) heading: Option<i64>,
464    /// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub(crate) proximity_alert_radius: Option<i64>,
467    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
468    #[serde(skip_serializing_if = "Option::is_none")]
469    pub(crate) disable_notification: Option<bool>,
470    /// Protects the contents of the sent message from forwarding and saving
471    #[serde(skip_serializing_if = "Option::is_none")]
472    pub(crate) protect_content: Option<bool>,
473    /// If the message is a reply, ID of the original message
474    #[serde(skip_serializing_if = "Option::is_none")]
475    pub(crate) reply_to_message_id: Option<i64>,
476    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
477    #[serde(skip_serializing_if = "Option::is_none")]
478    pub(crate) allow_sending_without_reply: Option<bool>,
479    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
480    #[serde(skip_serializing_if = "Option::is_none")]
481    pub(crate) reply_markup: Option<ReplyMarkup>,
482}
483
484/// Use this method to edit live location messages. A location can be edited until its <em>live_period</em> expires or editing is explicitly disabled by a call to [`stop_message_live_location`][crate::Bot::stop_message_live_location]. On success, if the edited message is not an inline message, the edited [`Message`][crate::models::Message] is returned, otherwise `true` is returned.
485#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
486pub struct EditMessageLiveLocation {
487    /// Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format @channel|username)
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub(crate) chat_id: Option<ChatId>,
490    /// Required if <em>inline_message_id</em> is not specified. Identifier of the message to edit
491    #[serde(skip_serializing_if = "Option::is_none")]
492    pub(crate) message_id: Option<i64>,
493    /// Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message
494    #[serde(skip_serializing_if = "Option::is_none")]
495    pub(crate) inline_message_id: Option<String>,
496    /// Latitude of new location
497    pub(crate) latitude: f64,
498    /// Longitude of new location
499    pub(crate) longitude: f64,
500    /// The radius of uncertainty for the location, measured in meters; 0-1500
501    #[serde(skip_serializing_if = "Option::is_none")]
502    pub(crate) horizontal_accuracy: Option<f64>,
503    /// Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub(crate) heading: Option<i64>,
506    /// The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
507    #[serde(skip_serializing_if = "Option::is_none")]
508    pub(crate) proximity_alert_radius: Option<i64>,
509    /// A JSON-serialized object for a new <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>.
510    #[serde(skip_serializing_if = "Option::is_none")]
511    pub(crate) reply_markup: Option<ReplyMarkup>,
512}
513
514/// Use this method to stop updating a live location message before <em>live_period</em> expires. On success, if the message is not an inline message, the edited [`Message`][crate::models::Message] is returned, otherwise `true` is returned.
515#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
516pub struct StopMessageLiveLocation {
517    /// Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format @channel|username)
518    #[serde(skip_serializing_if = "Option::is_none")]
519    pub(crate) chat_id: Option<ChatId>,
520    /// Required if <em>inline_message_id</em> is not specified. Identifier of the message with live location to stop
521    #[serde(skip_serializing_if = "Option::is_none")]
522    pub(crate) message_id: Option<i64>,
523    /// Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message
524    #[serde(skip_serializing_if = "Option::is_none")]
525    pub(crate) inline_message_id: Option<String>,
526    /// A JSON-serialized object for a new <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>.
527    #[serde(skip_serializing_if = "Option::is_none")]
528    pub(crate) reply_markup: Option<ReplyMarkup>,
529}
530
531/// Use this method to send information about a venue. On success, the sent [`Message`][crate::models::Message] is returned.
532#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
533pub struct SendVenue {
534    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
535    #[serde(skip_serializing_if = "Option::is_none")]
536    pub(crate) message_thread_id: Option<i64>,
537    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
538    pub(crate) chat_id: ChatId,
539    /// Latitude of the venue
540    pub(crate) latitude: f64,
541    /// Longitude of the venue
542    pub(crate) longitude: f64,
543    /// Name of the venue
544    pub(crate) title: String,
545    /// Address of the venue
546    pub(crate) address: String,
547    /// Foursquare identifier of the venue
548    #[serde(skip_serializing_if = "Option::is_none")]
549    pub(crate) foursquare_id: Option<String>,
550    /// Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
551    #[serde(skip_serializing_if = "Option::is_none")]
552    pub(crate) foursquare_type: Option<String>,
553    /// Google Places identifier of the venue
554    #[serde(skip_serializing_if = "Option::is_none")]
555    pub(crate) google_place_id: Option<String>,
556    /// Google Places type of the venue. (See <a href="https://developers.google.com/places/web-service/supported_types">supported types</a>.)
557    #[serde(skip_serializing_if = "Option::is_none")]
558    pub(crate) google_place_type: Option<String>,
559    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
560    #[serde(skip_serializing_if = "Option::is_none")]
561    pub(crate) disable_notification: Option<bool>,
562    /// Protects the contents of the sent message from forwarding and saving
563    #[serde(skip_serializing_if = "Option::is_none")]
564    pub(crate) protect_content: Option<bool>,
565    /// If the message is a reply, ID of the original message
566    #[serde(skip_serializing_if = "Option::is_none")]
567    pub(crate) reply_to_message_id: Option<i64>,
568    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
569    #[serde(skip_serializing_if = "Option::is_none")]
570    pub(crate) allow_sending_without_reply: Option<bool>,
571    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
572    #[serde(skip_serializing_if = "Option::is_none")]
573    pub(crate) reply_markup: Option<ReplyMarkup>,
574}
575
576/// Use this method to send phone contacts. On success, the sent [`Message`][crate::models::Message] is returned.
577#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
578pub struct SendContact {
579    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
580    #[serde(skip_serializing_if = "Option::is_none")]
581    pub(crate) message_thread_id: Option<i64>,
582    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
583    pub(crate) chat_id: ChatId,
584    /// Contact&#39;s phone number
585    pub(crate) phone_number: String,
586    /// Contact&#39;s first name
587    pub(crate) first_name: String,
588    /// Contact&#39;s last name
589    #[serde(skip_serializing_if = "Option::is_none")]
590    pub(crate) last_name: Option<String>,
591    /// Additional data about the contact in the form of a <a href="https://en.wikipedia.org/wiki/VCard">vCard</a>, 0-2048 bytes
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub(crate) vcard: Option<String>,
594    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
595    #[serde(skip_serializing_if = "Option::is_none")]
596    pub(crate) disable_notification: Option<bool>,
597    /// Protects the contents of the sent message from forwarding and saving
598    #[serde(skip_serializing_if = "Option::is_none")]
599    pub(crate) protect_content: Option<bool>,
600    /// If the message is a reply, ID of the original message
601    #[serde(skip_serializing_if = "Option::is_none")]
602    pub(crate) reply_to_message_id: Option<i64>,
603    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
604    #[serde(skip_serializing_if = "Option::is_none")]
605    pub(crate) allow_sending_without_reply: Option<bool>,
606    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove keyboard or to force a reply from the user.
607    #[serde(skip_serializing_if = "Option::is_none")]
608    pub(crate) reply_markup: Option<ReplyMarkup>,
609}
610
611/// Use this method to send a native poll. On success, the sent [`Message`][crate::models::Message] is returned.
612#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
613pub struct SendPoll {
614    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
615    #[serde(skip_serializing_if = "Option::is_none")]
616    pub(crate) message_thread_id: Option<i64>,
617    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
618    pub(crate) chat_id: ChatId,
619    /// Poll question, 1-300 characters
620    pub(crate) question: String,
621    /// A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
622    #[serde(skip_serializing_if = "Vec::is_empty")]
623    pub(crate) options: Vec<String>,
624    /// <em>True</em>, if the poll needs to be anonymous, defaults to <em>True</em>
625    #[serde(skip_serializing_if = "Option::is_none")]
626    pub(crate) is_anonymous: Option<bool>,
627    /// Poll type, “quiz” or “regular”, defaults to “regular”
628    #[serde(skip_serializing_if = "Option::is_none")]
629    pub(crate) _type: Option<String>,
630    /// <em>True</em>, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to <em>False</em>
631    #[serde(skip_serializing_if = "Option::is_none")]
632    pub(crate) allows_multiple_answers: Option<bool>,
633    /// 0-based identifier of the correct answer option, required for polls in quiz mode
634    #[serde(skip_serializing_if = "Option::is_none")]
635    pub(crate) correct_option_id: Option<i64>,
636    /// 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 with at most 2 line feeds after entities parsing
637    #[serde(skip_serializing_if = "Option::is_none")]
638    pub(crate) explanation: Option<String>,
639    /// Mode for parsing entities in the explanation. See <a href="#formatting-options">formatting options</a> for more details.
640    #[serde(skip_serializing_if = "Option::is_none")]
641    pub(crate) explanation_parse_mode: Option<String>,
642    /// A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of <em>parse_mode</em>
643    #[serde(skip_serializing_if = "Vec::is_empty")]
644    pub(crate) explanation_entities: Vec<MessageEntity>,
645    /// Amount of time in seconds the poll will be active after creation, 5-600. Can&#39;t be used together with <em>close_date</em>.
646    #[serde(skip_serializing_if = "Option::is_none")]
647    pub(crate) open_period: Option<i64>,
648    /// Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can&#39;t be used together with <em>open_period</em>.
649    #[serde(skip_serializing_if = "Option::is_none")]
650    pub(crate) close_date: Option<i64>,
651    /// Pass <em>True</em> if the poll needs to be immediately closed. This can be useful for poll preview.
652    #[serde(skip_serializing_if = "Option::is_none")]
653    pub(crate) is_closed: Option<bool>,
654    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
655    #[serde(skip_serializing_if = "Option::is_none")]
656    pub(crate) disable_notification: Option<bool>,
657    /// Protects the contents of the sent message from forwarding and saving
658    #[serde(skip_serializing_if = "Option::is_none")]
659    pub(crate) protect_content: Option<bool>,
660    /// If the message is a reply, ID of the original message
661    #[serde(skip_serializing_if = "Option::is_none")]
662    pub(crate) reply_to_message_id: Option<i64>,
663    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
664    #[serde(skip_serializing_if = "Option::is_none")]
665    pub(crate) allow_sending_without_reply: Option<bool>,
666    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
667    #[serde(skip_serializing_if = "Option::is_none")]
668    pub(crate) reply_markup: Option<ReplyMarkup>,
669}
670
671/// Use this method to send an animated emoji that will display a random value. On success, the sent [`Message`][crate::models::Message] is returned.
672#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
673pub struct SendDice {
674    /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
675    #[serde(skip_serializing_if = "Option::is_none")]
676    pub(crate) message_thread_id: Option<i64>,
677    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
678    pub(crate) chat_id: ChatId,
679    /// Emoji on which the dice throw animation is based. Currently, must be one of “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />”, or “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />”. Dice can have values 1-6 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />”, values 1-5 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />”, and values 1-64 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />”. Defaults to “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”
680    #[serde(skip_serializing_if = "Option::is_none")]
681    pub(crate) emoji: Option<String>,
682    /// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
683    #[serde(skip_serializing_if = "Option::is_none")]
684    pub(crate) disable_notification: Option<bool>,
685    /// Protects the contents of the sent message from forwarding
686    #[serde(skip_serializing_if = "Option::is_none")]
687    pub(crate) protect_content: Option<bool>,
688    /// If the message is a reply, ID of the original message
689    #[serde(skip_serializing_if = "Option::is_none")]
690    pub(crate) reply_to_message_id: Option<i64>,
691    /// Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found
692    #[serde(skip_serializing_if = "Option::is_none")]
693    pub(crate) allow_sending_without_reply: Option<bool>,
694    /// Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.
695    #[serde(skip_serializing_if = "Option::is_none")]
696    pub(crate) reply_markup: Option<ReplyMarkup>,
697}
698
699/// Use this method when you need to tell the user that something is happening on the bot&#39;s side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns `true` on success.</p><blockquote><p>Example: The [ImageBot](https://t.me/imagebot) needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use [`send_chat_action`][crate::Bot::send_chat_action] with <em>action</em> = <em>upload_photo</em>. The user will see a “sending photo” status for the bot.</p></blockquote><p>We only recommend using this method when a response from the bot will take a <strong>noticeable</strong> amount of time to arrive.
700#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
701pub struct SendChatAction {
702    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
703    pub(crate) chat_id: ChatId,
704    /// Unique identifier for the target message thread; supergroups only
705    #[serde(skip_serializing_if = "Option::is_none")]
706    pub(crate) message_thread_id: Option<i32>,
707    /// Type of action to broadcast. Choose one, depending on what the user is about to receive: <em>typing</em> for <a href="#sendmessage">text messages</a>, <em>upload_photo</em> for <a href="#sendphoto">photos</a>, <em>record_video</em> or <em>upload_video</em> for <a href="#sendvideo">videos</a>, <em>record_voice</em> or <em>upload_voice</em> for <a href="#sendvoice">voice notes</a>, <em>upload_document</em> for <a href="#senddocument">general files</a>, <em>choose_sticker</em> for <a href="#sendsticker">stickers</a>, <em>find_location</em> for <a href="#sendlocation">location data</a>, <em>record_video_note</em> or <em>upload_video_note</em> for <a href="#sendvideonote">video notes</a>.
708    pub(crate) action: String,
709}
710
711/// Use this method to get a list of profile pictures for a user. Returns a[`UserProfilePhotos`][crate::models::UserProfilePhotos] object.
712#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
713pub struct GetUserProfilePhotos {
714    /// Unique identifier of the target user
715    pub(crate) user_id: i64,
716    /// Sequential number of the first photo to be returned. By default, all photos are returned.
717    #[serde(skip_serializing_if = "Option::is_none")]
718    pub(crate) offset: Option<i64>,
719    /// Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
720    #[serde(skip_serializing_if = "Option::is_none")]
721    pub(crate) limit: Option<i64>,
722}
723
724/// Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a [`File`][crate::models::File] object is returned. The file can then be downloaded via the link `https://api.telegram.org/file/bot<token>/<file_path>`, where `<file_path>;` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling [`get_file`][crate::Bot::get_file] again.
725#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
726pub struct GetFile {
727    /// File identifier to get information about
728    pub(crate) file_id: String,
729}
730
731/// Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless [`unbanned`][crate::Bot::unban_chat_member] first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns `true` on success.
732#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
733pub struct BanChatMember {
734    /// Unique identifier for the target group or username of the target supergroup or channel (in the format @channel|username)
735    pub(crate) chat_id: ChatId,
736    /// Unique identifier of the target user
737    pub(crate) user_id: i64,
738    /// Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.
739    #[serde(skip_serializing_if = "Option::is_none")]
740    pub(crate) until_date: Option<i64>,
741    /// Pass <em>True</em> to delete all messages from the chat for the user that is being removed. If <em>False</em>, the user will be able to see messages in the group that were sent before the user was removed. Always <em>True</em> for supergroups and channels.
742    #[serde(skip_serializing_if = "Option::is_none")]
743    pub(crate) revoke_messages: Option<bool>,
744}
745
746/// Use this method to unban a previously banned user in a supergroup or channel. The user will <strong>not</strong> return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be <strong>removed</strong> from the chat. If you don&#39;t want this, use the parameter <em>only_if_banned</em>. Returns `true` on success.
747#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
748pub struct UnbanChatMember {
749    /// Unique identifier for the target group or username of the target supergroup or channel (in the format @channel|username)
750    pub(crate) chat_id: ChatId,
751    /// Unique identifier of the target user
752    pub(crate) user_id: i64,
753    /// Do nothing if the user is not banned
754    #[serde(skip_serializing_if = "Option::is_none")]
755    pub(crate) only_if_banned: Option<bool>,
756}
757
758/// Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass `true` for all permissions to lift restrictions from a user. Returns `true` on success.
759#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
760pub struct RestrictChatMember {
761    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroup|username)
762    pub(crate) chat_id: ChatId,
763    /// Unique identifier of the target user
764    pub(crate) user_id: i64,
765    /// A JSON-serialized object for new user permissions
766    pub(crate) permissions: ChatPermissions,
767    /// Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
768    #[serde(skip_serializing_if = "Option::is_none")]
769    pub(crate) until_date: Option<i64>,
770}
771
772/// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass <em>False</em> for all boolean parameters to demote a user. Returns `true` on success.
773#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
774pub struct PromoteChatMember {
775    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
776    pub(crate) chat_id: ChatId,
777    /// Unique identifier of the target user
778    pub(crate) user_id: i64,
779    /// Pass <em>True</em> if the administrator&#39;s presence in the chat is hidden
780    #[serde(skip_serializing_if = "Option::is_none")]
781    pub(crate) is_anonymous: Option<bool>,
782    /// Pass <em>True</em> if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
783    #[serde(skip_serializing_if = "Option::is_none")]
784    pub(crate) can_manage_chat: Option<bool>,
785    /// Pass <em>True</em> if the administrator can create channel posts, channels only
786    #[serde(skip_serializing_if = "Option::is_none")]
787    pub(crate) can_post_messages: Option<bool>,
788    /// Pass <em>True</em> if the administrator can edit messages of other users and can pin messages, channels only
789    #[serde(skip_serializing_if = "Option::is_none")]
790    pub(crate) can_edit_messages: Option<bool>,
791    /// Pass <em>True</em> if the administrator can delete messages of other users
792    #[serde(skip_serializing_if = "Option::is_none")]
793    pub(crate) can_delete_messages: Option<bool>,
794    /// Pass <em>True</em> if the administrator can manage video chats
795    #[serde(skip_serializing_if = "Option::is_none")]
796    pub(crate) can_manage_video_chats: Option<bool>,
797    /// Pass <em>True</em> if the administrator can restrict, ban or unban chat members
798    #[serde(skip_serializing_if = "Option::is_none")]
799    pub(crate) can_restrict_members: Option<bool>,
800    /// Pass <em>True</em> if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
801    #[serde(skip_serializing_if = "Option::is_none")]
802    pub(crate) can_promote_members: Option<bool>,
803    /// Pass <em>True</em> if the administrator can change chat title, photo and other settings
804    #[serde(skip_serializing_if = "Option::is_none")]
805    pub(crate) can_change_info: Option<bool>,
806    /// Pass <em>True</em> if the administrator can invite new users to the chat
807    #[serde(skip_serializing_if = "Option::is_none")]
808    pub(crate) can_invite_users: Option<bool>,
809    /// Pass <em>True</em> if the administrator can pin messages, supergroups only
810    #[serde(skip_serializing_if = "Option::is_none")]
811    pub(crate) can_pin_messages: Option<bool>,
812    /// If the user is allowed to create, rename, close, and reopen forum topics; supergroups only
813    #[serde(default, skip_serializing_if = "Option::is_none")]
814    pub can_manage_topics: Option<bool>,
815}
816
817/// Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns `true` on success.
818#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
819pub struct SetChatAdministratorCustomTitle {
820    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroup|username)
821    pub(crate) chat_id: ChatId,
822    /// Unique identifier of the target user
823    pub(crate) user_id: i64,
824    /// New custom title for the administrator; 0-16 characters, emoji are not allowed
825    pub(crate) custom_title: String,
826}
827
828/// Use this method to ban a channel chat in a supergroup or a channel. Until the chat is [`unbanned`][crate::Bot::unban_chat_sender_chat], the owner of the banned chat won&#39;t be able to send messages on behalf of <strong>any of their channels</strong>. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns `true` on success.
829#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
830pub struct BanChatSenderChat {
831    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
832    pub(crate) chat_id: ChatId,
833    /// Unique identifier of the target sender chat
834    pub(crate) sender_chat_id: i64,
835}
836
837/// Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns `true` on success.
838#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
839pub struct UnbanChatSenderChat {
840    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
841    pub(crate) chat_id: ChatId,
842    /// Unique identifier of the target sender chat
843    pub(crate) sender_chat_id: i64,
844}
845
846/// Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the <em>can_restrict_members</em> administrator rights. Returns `true` on success.
847#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
848pub struct SetChatPermissions {
849    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroup|username)
850    pub(crate) chat_id: ChatId,
851    /// A JSON-serialized object for new default chat permissions
852    pub(crate) permissions: ChatPermissions,
853}
854
855/// Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as <em>String</em> on success.
856#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
857pub struct ExportChatInviteLink {
858    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
859    pub(crate) chat_id: ChatId,
860}
861
862/// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method [`revoke_chat_invite_link`][crate::Bot::revoke_chat_invite_link]. Returns the new invite link as [`ChatInviteLink`][crate::models::ChatInviteLink] object.
863#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
864pub struct CreateChatInviteLink {
865    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
866    pub(crate) chat_id: ChatId,
867    /// Invite link name; 0-32 characters
868    #[serde(skip_serializing_if = "Option::is_none")]
869    pub(crate) name: Option<String>,
870    /// Point in time (Unix timestamp) when the link will expire
871    #[serde(skip_serializing_if = "Option::is_none")]
872    pub(crate) expire_date: Option<i64>,
873    /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
874    #[serde(skip_serializing_if = "Option::is_none")]
875    pub(crate) member_limit: Option<i64>,
876    /// <em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can&#39;t be specified
877    #[serde(skip_serializing_if = "Option::is_none")]
878    pub(crate) creates_join_request: Option<bool>,
879}
880
881/// Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a [`ChatInviteLink`][crate::models::ChatInviteLink] object.
882#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
883pub struct EditChatInviteLink {
884    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
885    pub(crate) chat_id: ChatId,
886    /// The invite link to edit
887    pub(crate) invite_link: String,
888    /// Invite link name; 0-32 characters
889    #[serde(skip_serializing_if = "Option::is_none")]
890    pub(crate) name: Option<String>,
891    /// Point in time (Unix timestamp) when the link will expire
892    #[serde(skip_serializing_if = "Option::is_none")]
893    pub(crate) expire_date: Option<i64>,
894    /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
895    #[serde(skip_serializing_if = "Option::is_none")]
896    pub(crate) member_limit: Option<i64>,
897    /// <em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can&#39;t be specified
898    #[serde(skip_serializing_if = "Option::is_none")]
899    pub(crate) creates_join_request: Option<bool>,
900}
901
902/// Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as [`ChatInviteLink`][crate::models::ChatInviteLink] object.
903#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
904pub struct RevokeChatInviteLink {
905    /// Unique identifier of the target chat or username of the target channel (in the format @channel|username)
906    pub(crate) chat_id: ChatId,
907    /// The invite link to revoke
908    pub(crate) invite_link: String,
909}
910
911/// Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the <em>can_invite_users</em> administrator right. Returns `true` on success.
912#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
913pub struct ApproveChatJoinRequest {
914    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
915    pub(crate) chat_id: ChatId,
916    /// Unique identifier of the target user
917    pub(crate) user_id: i64,
918}
919
920/// Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the <em>can_invite_users</em> administrator right. Returns `true` on success.
921#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
922pub struct DeclineChatJoinRequest {
923    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
924    pub(crate) chat_id: ChatId,
925    /// Unique identifier of the target user
926    pub(crate) user_id: i64,
927}
928
929/// Use this method to set a new profile photo for the chat. Photos can&#39;t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns `true` on success.
930#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
931pub struct SetChatPhoto {
932    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
933    pub(crate) chat_id: ChatId,
934    /// New chat photo, uploaded using multipart/form-data
935    #[serde(skip_serializing_if = "SentFile::is_upload")]
936    pub(crate) photo: SentFile,
937}
938
939/// Use this method to delete a chat photo. Photos can&#39;t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns `true` on success.
940#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
941pub struct DeleteChatPhoto {
942    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
943    pub(crate) chat_id: ChatId,
944}
945
946/// Use this method to change the title of a chat. Titles can&#39;t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns `true` on success.
947#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
948pub struct SetChatTitle {
949    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
950    pub(crate) chat_id: ChatId,
951    /// New chat title, 1-255 characters
952    pub(crate) title: String,
953}
954
955/// Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns `true` on success.
956#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
957pub struct SetChatDescription {
958    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
959    pub(crate) chat_id: ChatId,
960    /// New chat description, 0-255 characters
961    #[serde(skip_serializing_if = "Option::is_none")]
962    pub(crate) description: Option<String>,
963}
964
965/// Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the &#39;can_pin_messages&#39; administrator right in a supergroup or &#39;can_edit_messages&#39; administrator right in a channel. Returns `true` on success.
966#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
967pub struct PinChatMessage {
968    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
969    pub(crate) chat_id: ChatId,
970    /// Identifier of a message to pin
971    pub(crate) message_id: i64,
972    /// Pass <em>True</em> if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
973    #[serde(skip_serializing_if = "Option::is_none")]
974    pub(crate) disable_notification: Option<bool>,
975}
976
977/// Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the &#39;can_pin_messages&#39; administrator right in a supergroup or &#39;can_edit_messages&#39; administrator right in a channel. Returns `true` on success.
978#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
979pub struct UnpinChatMessage {
980    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
981    pub(crate) chat_id: ChatId,
982    /// Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
983    #[serde(skip_serializing_if = "Option::is_none")]
984    pub(crate) message_id: Option<i64>,
985}
986
987/// Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the &#39;can_pin_messages&#39; administrator right in a supergroup or &#39;can_edit_messages&#39; administrator right in a channel. Returns `true` on success.
988#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
989pub struct UnpinAllChatMessages {
990    /// Unique identifier for the target chat or username of the target channel (in the format @channel|username)
991    pub(crate) chat_id: ChatId,
992}
993
994/// Use this method for your bot to leave a group, supergroup or channel. Returns `true` on success.
995#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
996pub struct LeaveChat {
997    /// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channel|username)
998    pub(crate) chat_id: ChatId,
999}
1000
1001/// Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a [`Chat`][crate::models::Chat] object on success.
1002#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1003pub struct GetChat {
1004    /// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channel|username)
1005    pub(crate) chat_id: ChatId,
1006}
1007
1008/// Use this method to get a list of administrators in a chat, which aren&#39;t bots. Returns an Array of [`ChatMember`][crate::models::ChatMember] objects.
1009#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1010pub struct GetChatAdministrators {
1011    /// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channel|username)
1012    pub(crate) chat_id: ChatId,
1013}
1014
1015/// Use this method to get the number of members in a chat. Returns <em>Int</em> on success.
1016#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1017pub struct GetChatMemberCount {
1018    /// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channel|username)
1019    pub(crate) chat_id: ChatId,
1020}
1021
1022/// Use this method to get information about a member of a chat. Returns a [`ChatMember`][crate::models::ChatMember] object on success.
1023#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1024pub struct GetChatMember {
1025    /// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channel|username)
1026    pub(crate) chat_id: ChatId,
1027    /// Unique identifier of the target user
1028    pub(crate) user_id: i64,
1029}
1030
1031/// Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field <em>can_set_sticker_set</em> optionally returned in [`get_chat`][crate::Bot::get_chat] requests to check if the bot can use this method. Returns `true` on success.
1032#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1033pub struct SetChatStickerSet {
1034    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroup|username)
1035    pub(crate) chat_id: ChatId,
1036    /// Name of the sticker set to be set as the group sticker set
1037    pub(crate) sticker_set_name: String,
1038}
1039
1040/// Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field <em>can_set_sticker_set</em> optionally returned in [`get_chat`][crate::Bot::get_chat] requests to check if the bot can use this method. Returns `true` on success.
1041#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1042pub struct DeleteChatStickerSet {
1043    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroup|username)
1044    pub(crate) chat_id: ChatId,
1045}
1046
1047/// Use this method to send answers to callback queries sent from [`inline keyboards`](https://core.telegram.org/bots/features#inline-keyboards). The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, `true` is returned.</p><blockquote><p>Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via [@BotFather](https://t.me/botfather) and accept the terms. Otherwise, you may use links like <code>t.me/your_bot?start=XXXX</code> that open your bot with a parameter
1048#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1049pub struct AnswerCallbackQuery {
1050    /// A JSON-serialized list of bot commands to be set as the list of the bot&#39;s commands. At most 100 commands can be specified.
1051    #[serde(skip_serializing_if = "Vec::is_empty")]
1052    pub(crate) commands: Vec<BotCommand>,
1053    /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to <a href="#botcommandscopedefault">BotCommandScopeDefault</a>.
1054    #[serde(skip_serializing_if = "Option::is_none")]
1055    pub(crate) scope: Option<BotCommandScope>,
1056    /// 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
1057    #[serde(skip_serializing_if = "Option::is_none")]
1058    pub(crate) language_code: Option<String>,
1059}
1060
1061/// Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns `true` on success
1062#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1063pub struct SetMyCommands {
1064    /// A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
1065    #[serde(skip_serializing_if = "Vec::is_empty")]
1066    pub(crate) commands: Vec<BotCommand>,
1067    /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
1068    #[serde(skip_serializing_if = "Option::is_none")]
1069    pub(crate) scope: Option<BotCommandScope>,
1070    /// 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
1071    #[serde(skip_serializing_if = "Option::is_none")]
1072    pub(crate) language_code: Option<String>,
1073}
1074
1075/// Use this method to delete the list of the bot&#39;s commands for the given scope and user language. After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users. Returns `true` on success.
1076#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1077pub struct DeleteMyCommands {
1078    /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to <a href="#botcommandscopedefault">BotCommandScopeDefault</a>.
1079    #[serde(skip_serializing_if = "Option::is_none")]
1080    pub(crate) scope: Option<BotCommandScope>,
1081    /// 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
1082    #[serde(skip_serializing_if = "Option::is_none")]
1083    pub(crate) language_code: Option<String>,
1084}
1085
1086/// Use this method to get the current list of the bot&#39;s commands for the given scope and user language. Returns an Array of [`BotCommand`][crate::models::BotCommand] objects. If commands aren&#39;t set, an empty list is returned.
1087#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1088pub struct GetMyCommands {
1089    /// A JSON-serialized object, describing scope of users. Defaults to <a href="#botcommandscopedefault">BotCommandScopeDefault</a>.
1090    #[serde(skip_serializing_if = "Option::is_none")]
1091    pub(crate) scope: Option<BotCommandScope>,
1092    /// A two-letter ISO 639-1 language code or an empty string
1093    #[serde(skip_serializing_if = "Option::is_none")]
1094    pub(crate) language_code: Option<String>,
1095}
1096
1097/// Use this method to change the bot&#39;s menu button in a private chat, or the default menu button. Returns `true` on success.
1098#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1099pub struct SetChatMenuButton {
1100    /// Unique identifier for the target private chat. If not specified, default bot&#39;s menu button will be changed
1101    #[serde(skip_serializing_if = "Option::is_none")]
1102    pub(crate) chat_id: Option<i64>,
1103    /// A JSON-serialized object for the bot&#39;s new menu button. Defaults to <a href="#menubuttondefault">MenuButtonDefault</a>
1104    #[serde(skip_serializing_if = "Option::is_none")]
1105    pub(crate) menu_button: Option<MenuButton>,
1106}
1107
1108/// Use this method to get the current value of the bot&#39;s menu button in a private chat, or the default menu button. Returns [`MenuButton`][crate::models::MenuButton] on success.
1109#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1110pub struct GetChatMenuButton {
1111    /// Unique identifier for the target private chat. If not specified, default bot&#39;s menu button will be returned
1112    #[serde(skip_serializing_if = "Option::is_none")]
1113    pub(crate) chat_id: Option<i64>,
1114}
1115
1116/// Use this method to change the default administrator rights requested by the bot when it&#39;s added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns `true` on success.
1117#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1118pub struct SetMyDefaultAdministratorRights {
1119    /// A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
1120    #[serde(skip_serializing_if = "Option::is_none")]
1121    pub(crate) rights: Option<ChatAdministratorRights>,
1122    /// Pass <em>True</em> to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.
1123    #[serde(skip_serializing_if = "Option::is_none")]
1124    pub(crate) for_channels: Option<bool>,
1125}
1126
1127/// Use this method to get the current default administrator rights of the bot. Returns [`ChatAdministratorRights`][crate::models::ChatAdministratorRights] on success.
1128#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1129pub struct GetMyDefaultAdministratorRights {
1130    /// Pass <em>True</em> to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.
1131    #[serde(skip_serializing_if = "Option::is_none")]
1132    pub(crate) for_channels: Option<bool>,
1133}
1134
1135/// Use this method to send invoices. On success, the sent Message is returned.
1136#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1137pub struct SendInvoice {
1138    /// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1139    pub(crate) chat_id: ChatId,
1140    /// Product name, 1-32 characters
1141    pub(crate) title: String,
1142    /// Product description, 1-255 characters
1143    pub(crate) description: String,
1144    /// Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
1145    pub(crate) payload: String,
1146    /// Payment provider token, obtained via @BotFather
1147    pub(crate) provider_token: String,
1148    /// Three-letter ISO 4217 currency code, see more on currencies
1149    pub(crate) currency: String,
1150    /// Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
1151    #[serde(skip_serializing_if = "Vec::is_empty")]
1152    pub(crate) prices: Vec<LabeledPrice>,
1153    /// 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
1154    #[serde(skip_serializing_if = "Option::is_none")]
1155    pub(crate) max_tip_amount: Option<i64>,
1156    /// A JSON-serialized array of suggested amounts of tips 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.
1157    #[serde(skip_serializing_if = "Vec::is_empty")]
1158    pub(crate) suggested_tip_amounts: Vec<i64>,
1159    /// Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter
1160    #[serde(skip_serializing_if = "Option::is_none")]
1161    pub(crate) start_parameter: Option<String>,
1162    /// JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
1163    #[serde(skip_serializing_if = "Option::is_none")]
1164    pub(crate) provider_data: Option<String>,
1165    /// URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
1166    #[serde(skip_serializing_if = "Option::is_none")]
1167    pub(crate) photo_url: Option<String>,
1168    /// Photo size in bytes
1169    #[serde(skip_serializing_if = "Option::is_none")]
1170    pub(crate) photo_size: Option<i64>,
1171    /// Photo width
1172    #[serde(skip_serializing_if = "Option::is_none")]
1173    pub(crate) photo_width: Option<i64>,
1174    /// Photo height
1175    #[serde(skip_serializing_if = "Option::is_none")]
1176    pub(crate) photo_height: Option<i64>,
1177    /// Pass True if you require the user's full name to complete the order
1178    #[serde(skip_serializing_if = "Option::is_none")]
1179    pub(crate) need_name: Option<bool>,
1180    /// Pass True if you require the user's phone number to complete the order
1181    #[serde(skip_serializing_if = "Option::is_none")]
1182    pub(crate) need_phone_number: Option<bool>,
1183    /// Pass True if you require the user's email address to complete the order
1184    #[serde(skip_serializing_if = "Option::is_none")]
1185    pub(crate) need_email: Option<bool>,
1186    /// Pass True if you require the user's shipping address to complete the order
1187    #[serde(skip_serializing_if = "Option::is_none")]
1188    pub(crate) need_shipping_address: Option<bool>,
1189    /// Pass True if the user's phone number should be sent to provider
1190    #[serde(skip_serializing_if = "Option::is_none")]
1191    pub(crate) send_phone_number_to_provider: Option<bool>,
1192    /// Pass True if the user's email address should be sent to provider
1193    #[serde(skip_serializing_if = "Option::is_none")]
1194    pub(crate) send_email_to_provider: Option<bool>,
1195    /// Pass True if the final price depends on the shipping method
1196    #[serde(skip_serializing_if = "Option::is_none")]
1197    pub(crate) is_flexible: Option<bool>,
1198    /// Sends the message silently. Users will receive a notification with no sound.
1199    #[serde(skip_serializing_if = "Option::is_none")]
1200    pub(crate) disable_notification: Option<bool>,
1201    /// Protects the contents of the sent message from forwarding and saving
1202    #[serde(skip_serializing_if = "Option::is_none")]
1203    pub(crate) protect_content: Option<bool>,
1204    /// If the message is a reply, ID of the original message
1205    #[serde(skip_serializing_if = "Option::is_none")]
1206    pub(crate) reply_to_message_id: Option<i64>,
1207    /// Pass True if the message should be sent even if the specified replied-to message is not found
1208    #[serde(skip_serializing_if = "Option::is_none")]
1209    pub(crate) allow_sending_without_reply: Option<bool>,
1210    /// A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
1211    #[serde(skip_serializing_if = "Option::is_none")]
1212    pub(crate) reply_markup: Option<InlineKeyboardMarkup>,
1213}
1214
1215/// Use this method to create a link for an invoice. Returns the created invoice link as String on success.
1216#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1217pub struct CreateInvoiceLink {
1218    /// Product name, 1-32 characters
1219    pub(crate) title: String,
1220    /// Product description, 1-255 characters
1221    pub(crate) description: String,
1222    /// Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
1223    pub(crate) payload: String,
1224    /// Payment provider token, obtained via BotFather
1225    pub(crate) provider_token: String,
1226    /// Three-letter ISO 4217 currency code, see more on currencies
1227    pub(crate) currency: String,
1228    /// Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
1229    #[serde(skip_serializing_if = "Vec::is_empty")]
1230    pub(crate) prices: Vec<LabeledPrice>,
1231    /// 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
1232    #[serde(skip_serializing_if = "Option::is_none")]
1233    pub(crate) max_tip_amount: Option<i64>,
1234    /// A JSON-serialized array of suggested amounts of tips 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.
1235    #[serde(skip_serializing_if = "Vec::is_empty")]
1236    pub(crate) suggested_tip_amounts: Vec<i64>,
1237    /// JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
1238    #[serde(skip_serializing_if = "Option::is_none")]
1239    pub(crate) provider_data: Option<String>,
1240    /// URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
1241    #[serde(skip_serializing_if = "Option::is_none")]
1242    pub(crate) photo_url: Option<String>,
1243    /// Photo size in bytes
1244    #[serde(skip_serializing_if = "Option::is_none")]
1245    pub(crate) photo_size: Option<i64>,
1246    /// Photo width
1247    #[serde(skip_serializing_if = "Option::is_none")]
1248    pub(crate) photo_width: Option<i64>,
1249    /// Photo height
1250    #[serde(skip_serializing_if = "Option::is_none")]
1251    pub(crate) photo_height: Option<i64>,
1252    /// Pass True if you require the user's full name to complete the order
1253    #[serde(skip_serializing_if = "Option::is_none")]
1254    pub(crate) need_name: Option<bool>,
1255    /// Pass True if you require the user's phone number to complete the order
1256    #[serde(skip_serializing_if = "Option::is_none")]
1257    pub(crate) need_phone_number: Option<bool>,
1258    /// Pass True if you require the user's email address to complete the order
1259    #[serde(skip_serializing_if = "Option::is_none")]
1260    pub(crate) need_email: Option<bool>,
1261    /// Pass True if you require the user's shipping address to complete the order
1262    #[serde(skip_serializing_if = "Option::is_none")]
1263    pub(crate) need_shipping_address: Option<bool>,
1264    /// Pass True if the user's phone number should be sent to the provider
1265    #[serde(skip_serializing_if = "Option::is_none")]
1266    pub(crate) send_phone_number_to_provider: Option<bool>,
1267    /// Pass True if the user's email address should be sent to the provider
1268    #[serde(skip_serializing_if = "Option::is_none")]
1269    pub(crate) send_email_to_provider: Option<bool>,
1270    /// Pass True if the final price depends on the shipping method
1271    #[serde(skip_serializing_if = "Option::is_none")]
1272    pub(crate) is_flexible: Option<bool>,
1273}
1274
1275/// If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
1276#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1277pub struct AnswerShippingQuery {
1278    /// Unique identifier for the query to be answered
1279    pub(crate) shipping_query_id: String,
1280    /// Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
1281    pub(crate) ok: bool,
1282    /// Required if ok is True. A JSON-serialized array of available shipping options.
1283    #[serde(skip_serializing_if = "Vec::is_empty")]
1284    pub(crate) shipping_options: Vec<ShippingOption>,
1285    /// Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
1286    #[serde(skip_serializing_if = "Option::is_none")]
1287    pub(crate) error_message: Option<String>,
1288}
1289
1290/// Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
1291#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1292pub struct AnswerPreCheckoutQuery {
1293    /// Unique identifier for the query to be answered
1294    pub(crate) pre_checkout_query_id: String,
1295    /// Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
1296    pub(crate) ok: bool,
1297    /// Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
1298    #[serde(skip_serializing_if = "Option::is_none")]
1299    pub(crate) error_message: Option<String>,
1300}
1301
1302/// Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
1303///
1304/// Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
1305#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1306pub struct SetPasswordDataErrors {
1307    user_id: i64,
1308    errors: Vec<PassportElementError>,
1309}
1310
1311/// Use this method to send a game. On success, the sent Message is returned.
1312#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1313pub struct SendGame {
1314    /// Unique identifier for the target chat
1315    pub(crate) chat_id: i64,
1316    /// Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.
1317    pub(crate) game_short_name: String,
1318    /// Sends the message silently. Users will receive a notification with no sound.
1319    #[serde(skip_serializing_if = "Option::is_none")]
1320    pub(crate) disable_notification: Option<bool>,
1321    /// Protects the contents of the sent message from forwarding and saving
1322    #[serde(skip_serializing_if = "Option::is_none")]
1323    pub(crate) protect_content: Option<bool>,
1324    /// If the message is a reply, ID of the original message
1325    #[serde(skip_serializing_if = "Option::is_none")]
1326    pub(crate) reply_to_message_id: Option<i64>,
1327    /// Pass True if the message should be sent even if the specified replied-to message is not found
1328    #[serde(skip_serializing_if = "Option::is_none")]
1329    pub(crate) allow_sending_without_reply: Option<bool>,
1330    /// A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
1331    #[serde(skip_serializing_if = "Option::is_none")]
1332    pub(crate) reply_markup: Option<InlineKeyboardMarkup>,
1333}
1334
1335/// Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
1336#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1337pub struct SetGameScore {
1338    /// User identifier
1339    pub(crate) user_id: i64,
1340    /// New score, must be non-negative
1341    pub(crate) score: i64,
1342    /// Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
1343    #[serde(skip_serializing_if = "Option::is_none")]
1344    pub(crate) force: Option<bool>,
1345    /// Pass True if the game message should not be automatically edited to include the current scoreboard
1346    #[serde(skip_serializing_if = "Option::is_none")]
1347    pub(crate) disable_edit_message: Option<bool>,
1348
1349    #[serde(flatten)]
1350    message_id: GameScoreMessageId,
1351}
1352
1353/// Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.
1354///
1355/// This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.
1356#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1357pub struct GetGameHighScores {
1358    /// Target user id
1359    pub(crate) user_id: i64,
1360
1361    #[serde(flatten)]
1362    message_id: GameScoreMessageId,
1363}
1364
1365#[derive(Serialize, Deserialize, Clone, Debug)]
1366#[allow(missing_docs)]
1367pub enum GameScoreMessageId {
1368    Inline {
1369        /// Identifier of the inline message
1370        inline_message_id: String,
1371    },
1372    NotInline {
1373        /// Required if inline_message_id is not specified. Unique identifier for the target chat
1374        chat_id: i64,
1375        /// Required if inline_message_id is not specified. Identifier of the sent message
1376        message_id: i64,
1377    },
1378}
1379
1380/// Use this method to send answers to an inline query. On success, True is returned.
1381#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1382pub struct AnswerInlineQuery {
1383    /// Unique identifier for the answered query
1384    pub(crate) inline_query_id: String,
1385    /// A JSON-serialized array of results for the inline query
1386    /// No more than 50 results per query are allowed.
1387    #[serde(skip_serializing_if = "Vec::is_empty")]
1388    pub(crate) results: Vec<InlineQueryResult>,
1389    /// The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
1390    #[serde(skip_serializing_if = "Option::is_none")]
1391    pub(crate) cache_time: Option<i64>,
1392    /// Pass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query
1393    #[serde(skip_serializing_if = "Option::is_none")]
1394    pub(crate) is_personal: Option<bool>,
1395    /// Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
1396    #[serde(skip_serializing_if = "Option::is_none")]
1397    pub(crate) next_offset: Option<String>,
1398    /// If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter
1399    #[serde(skip_serializing_if = "Option::is_none")]
1400    pub(crate) switch_pm_text: Option<String>,
1401    /// Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
1402    ///
1403    /// 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.
1404    #[serde(skip_serializing_if = "Option::is_none")]
1405    pub(crate) switch_pm_parameter: Option<String>,
1406}
1407
1408/// Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
1409#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1410pub struct AnswerWebAppQuery {
1411    /// Unique identifier for the query to be answered
1412    pub(crate) web_app_query_id: String,
1413    /// A JSON-serialized object describing the message to be sent
1414    pub(crate) result: InlineQueryResult,
1415}
1416
1417/// Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
1418#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1419pub struct CreateForumTopic {
1420    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1421    chat_id: ChatId,
1422    /// Topic name, 1-128 characters
1423    name: String,
1424    /// Color of the topic icon in RGB format. Currently, must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F
1425    #[serde(default, skip_serializing_if = "Option::is_none")]
1426    icon_color: Option<i64>,
1427    /// Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
1428    #[serde(default, skip_serializing_if = "Option::is_none")]
1429    icon_custom_emoji_id: Option<String>,
1430}
1431
1432/// Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
1433#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1434pub struct EditForumTopic {
1435    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1436    #[serde(default, skip_serializing_if = "Option::is_none")]
1437    chat_id: Option<ChatId>,
1438    /// Unique identifier for the target message thread of the forum topic
1439    message_thread_id: i64,
1440    /// New topic name, 1-128 characters
1441    name: String,
1442    /// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
1443    #[serde(default, skip_serializing_if = "Option::is_none")]
1444    icon_custom_emoji_id: Option<String>,
1445}
1446
1447/// Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
1448#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1449pub struct CloseForumTopic {
1450    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1451    chat_id: ChatId,
1452    /// Unique identifier for the target message thread of the forum topic
1453    message_thread_id: i64,
1454}
1455
1456/// Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
1457#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1458pub struct ReopenForumTopic {
1459    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1460    chat_id: ChatId,
1461    /// Unique identifier for the target message thread of the forum topic
1462    message_thread_id: i64,
1463}
1464
1465/// Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
1466#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1467pub struct DeleteForumTopic {
1468    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1469    chat_id: ChatId,
1470    /// Unique identifier for the target message thread of the forum topic
1471    message_thread_id: i64,
1472}
1473
1474/// Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
1475#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1476pub struct UnpinAllForumTopicMessages {
1477    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1478    chat_id: ChatId,
1479    /// Unique identifier for the target message thread of the forum topic
1480    message_thread_id: i64,
1481}
1482
1483
1484/// Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
1485#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1486pub struct EditGeneralForumTopic {
1487    /// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1488    chat_id: ChatId,
1489    /// New topic name, 1-128 characters
1490    name: String,
1491}
1492
1493/// Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
1494#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1495pub struct CloseGeneralForumTopic {
1496    /// Unique identifier for the target chat or username of the target supergroup ( in the format @ supergroupusername)
1497    chat_id: ChatId,
1498}
1499
1500/// Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
1501#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1502pub struct ReopenGeneralForumTopic {
1503    /// Unique identifier for the target chat or username of the target supergroup ( in the format @ supergroupusername)
1504    chat_id: ChatId,
1505}
1506
1507/// Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
1508#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1509pub struct HideGeneralForumTopic {
1510    /// Unique identifier for the target chat or username of the target supergroup ( in the format @ supergroupusername)
1511    chat_id: ChatId,
1512}
1513
1514/// Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
1515#[derive(Serialize, Deserialize, Clone, Debug, Builder, FileHolder)]
1516pub struct UnhideGeneralForumTopic {
1517    /// Unique identifier for the target chat or username of the target supergroup ( in the format @ supergroupusername)
1518    chat_id: ChatId,
1519}