Skip to main content

teloxide_core/payloads/
send_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 = photo]
12    /// Use this method to send photos. On success, the sent [`Message`] is returned.
13    ///
14    /// [`Message`]: crate::types::Message
15    #[derive(Debug, Clone, Serialize)]
16    pub SendPhoto (SendPhotoSetters) => Message {
17        required {
18            /// Photo to send. Pass a file_id as FileId 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. [More info on Sending Files »]
19            ///
20            /// [More info on Sending Files »]: crate::types::InputFile
21            pub photo: InputFile,
22        }
23        optional {
24            /// Unique identifier of the business connection on behalf of which the message will be sent
25            pub business_connection_id: BusinessConnectionId,
26            /// 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
27            pub chat_id: Recipient [into],
28            /// A JSON-serialized object containing the parameters of the ephemeral message to send
29            pub ephemeral_message_parameters: EphemeralMessageParameters,
30            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
31            pub message_thread_id: ThreadId,
32            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
33            pub direct_messages_topic_id: TopicId,
34            /// Photo caption (may also be used when resending photos by _file\_id_), 0-1024 characters after entities parsing
35            pub caption: String [into],
36            /// Mode for parsing entities in the photo caption. See [formatting options] for more details.
37            ///
38            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
39            pub parse_mode: ParseMode,
40            /// List of special entities that appear in the photo caption, which can be specified instead of _parse\_mode_
41            pub caption_entities: Vec<MessageEntity> [collect],
42            /// Pass True, if the caption must be shown above the message media
43            pub show_caption_above_media: bool,
44            /// Pass True if the photo needs to be covered with a spoiler animation
45            pub has_spoiler: bool,
46            /// Sends the message [silently]. Users will receive a notification with no sound.
47            ///
48            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
49            pub disable_notification: bool,
50            /// Protects the contents of sent messages from forwarding and saving
51            pub protect_content: bool,
52            /// 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
53            pub allow_paid_broadcast: bool,
54            /// Unique identifier of the message effect to be added to the message; for private chats only
55            pub message_effect_id: EffectId,
56            /// An 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.
57            pub suggested_post_parameters: SuggestedPostParameters,
58            /// Description of the message to reply to
59            pub reply_parameters: ReplyParameters,
60            /// 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.
61            ///
62            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
63            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
64            pub reply_markup: ReplyMarkup [into],
65        }
66    }
67}