Skip to main content

ronami_core/payloads/
edit_message_media.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::BusinessConnectionId;
6use crate::types::InlineKeyboardMarkup;
7use crate::types::InputMedia;
8use crate::types::Message;
9use crate::types::MessageId;
10use crate::types::Recipient;
11
12impl_payload! {
13    /// Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL. On success, the edited Message is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
14    ///
15    /// See also: [`EditMessageMediaInline`](crate::payloads::EditMessageMediaInline)
16    #[derive(Debug, Clone, Serialize)]
17    pub EditMessageMedia (EditMessageMediaSetters) => Message {
18        required {
19            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`).
20            pub chat_id: Recipient [into],
21            /// Identifier of the message to edit
22            #[serde(flatten)]
23            pub message_id: MessageId,
24            /// A JSON-serialized object for a new media content of the message
25            pub media: InputMedia,
26        }
27        optional {
28            /// Unique identifier of the business connection on behalf of which the message to be edited was sent
29            pub business_connection_id: BusinessConnectionId,
30            /// A JSON-serialized object for an [inline keyboard].
31            ///
32            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
33            pub reply_markup: InlineKeyboardMarkup,
34        }
35    }
36}