teloxide_core/payloads/send_animation.rs
1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6 BusinessConnectionId, EffectId, InputFile, Message, MessageEntity, ParseMode, Recipient,
7 ReplyMarkup, ReplyParameters, ThreadId,
8};
9
10impl_payload! {
11 @[multipart = animation, thumbnail]
12 /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent [`Message`] is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
13 ///
14 /// [`Message`]: crate::types::Message
15 #[derive(Debug, Clone, Serialize)]
16 pub SendAnimation (SendAnimationSetters) => Message {
17 required {
18 /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
19 pub chat_id: Recipient [into],
20 /// Animation to send. Pass a file_id as FileId 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. [More info on Sending Files »]
21 ///
22 /// [More info on Sending Files »]: crate::types::InputFile
23 pub animation: InputFile,
24 }
25 optional {
26 /// Unique identifier of the business connection on behalf of which the message will be sent
27 pub business_connection_id: BusinessConnectionId,
28 /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
29 pub message_thread_id: ThreadId,
30 /// Duration of the animation in seconds
31 pub duration: u32,
32 /// Animation width
33 pub width: u32,
34 /// Animation height
35 pub height: u32,
36 /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]
37 ///
38 /// [More info on Sending Files »]: crate::types::InputFile
39 pub thumbnail: InputFile,
40 /// Animation caption (may also be used when resending videos by _file\_id_), 0-1024 characters after entities parsing
41 pub caption: String [into],
42 /// Mode for parsing entities in the animation caption. See [formatting options] for more details.
43 ///
44 /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
45 pub parse_mode: ParseMode,
46 /// List of special entities that appear in the photo caption, which can be specified instead of _parse\_mode_
47 pub caption_entities: Vec<MessageEntity> [collect],
48 /// Pass True, if the caption must be shown above the message media
49 pub show_caption_above_media: bool,
50 /// Pass True if the animation needs to be covered with a spoiler animation
51 pub has_spoiler: bool,
52 /// Sends the message [silently]. Users will receive a notification with no sound.
53 ///
54 /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
55 pub disable_notification: bool,
56 /// Protects the contents of sent messages from forwarding and saving
57 pub protect_content: bool,
58 /// Pass `true` to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
59 pub allow_paid_broadcast: bool,
60 /// Unique identifier of the message effect to be added to the message; for private chats only
61 pub message_effect_id: EffectId,
62 /// Description of the message to reply to
63 pub reply_parameters: ReplyParameters,
64 /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
65 ///
66 /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
67 /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
68 pub reply_markup: ReplyMarkup [into],
69 }
70 }
71}