Skip to main content

teloxide_core/payloads/
send_live_photo.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    BusinessConnectionId, EffectId, EphemeralMessageParameters, InputFile, Message, MessageEntity,
7    ParseMode, Recipient, ReplyMarkup, ReplyParameters, SuggestedPostParameters, ThreadId, TopicId,
8};
9
10impl_payload! {
11    @[multipart = live_photo, photo]
12    /// Use this method to send live photos. On success, the sent [`Message`] is returned.
13    ///
14    /// [`Message`]: crate::types::Message
15    #[derive(Debug, Clone, Serialize)]
16    pub SendLivePhoto (SendLivePhotoSetters) => Message {
17        required {
18            /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. [More information on Sending Files »] Sending live photos by a URL is currently unsupported.
19            ///
20            /// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
21            pub live_photo: InputFile,
22            /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. [More information on Sending Files »] Sending live photos by a URL is currently unsupported.
23            ///
24            /// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
25            pub photo: InputFile,
26        }
27        optional {
28            /// Unique identifier of the business connection on behalf of which the message will be sent
29            pub business_connection_id: BusinessConnectionId,
30            /// Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format `@username`; required unless the message is sent as an ephemeral reply to a callback query
31            pub chat_id: Recipient [into],
32            /// A JSON-serialized object containing the parameters of the ephemeral message to send
33            pub ephemeral_message_parameters: EphemeralMessageParameters,
34            /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
35            pub message_thread_id: ThreadId,
36            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
37            pub direct_messages_topic_id: TopicId,
38            /// Video caption (may also be used when resending videos by _file\_id_), 0-1024 characters after entities parsing
39            pub caption: String [into],
40            /// Mode for parsing entities in the video caption. See [formatting options] for more details.
41            ///
42            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
43            pub parse_mode: ParseMode,
44            /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of _parse\_mode_
45            pub caption_entities: Vec<MessageEntity> [collect],
46            /// Pass _True_, if the caption must be shown above the message media
47            pub show_caption_above_media: bool,
48            /// Pass _True_ if the video needs to be covered with a spoiler animation
49            pub has_spoiler: bool,
50            /// Sends the message [silently]. Users will receive a notification with no sound.
51            ///
52            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
53            pub disable_notification: bool,
54            /// Protects the contents of the sent message from forwarding and saving
55            pub protect_content: bool,
56            /// 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.
57            ///
58            /// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
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            /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
63            pub suggested_post_parameters: SuggestedPostParameters,
64            /// Description of the message to reply to
65            pub reply_parameters: ReplyParameters,
66            /// 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.
67            ///
68            /// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
69            /// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
70            pub reply_markup: ReplyMarkup [into],
71        }
72    }
73}