Skip to main content

ronami_core/payloads/
send_media_group.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    BusinessConnectionId, EffectId, InputMedia, Message, Recipient, ReplyParameters, ThreadId,
7    TopicId,
8};
9
10impl_payload! {
11    /// 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`]s that were sent is returned.
12    ///
13    /// ## Captions
14    ///
15    /// You may want to set a "global" caption which renders in the message, underneath the set of media. However, global captions for a media group are not part of the Telegram API. They result from how the official clients (at least) render a media group where only one [`InputMedia`] has a caption set. That captioned [`InputMedia`] may be in any position of the group.
16    ///
17    /// In order to set a "global" caption of a media group, set a caption for a single [`InputMedia`] in the group with the contents you wish to display underneath all media.
18    ///
19    /// If multiple [`InputMedia`] have captions, including identical ones, the official clients will not render a global caption underneath the group. Each individual media will keep its own caption however, which can be shown by the client when viewing the media individually, or by separating the media in its own message (for example by forwarding a single media from the media group).
20    ///
21    /// [`Message`]: crate::types::Message
22    /// [`InputMedia`]: crate::types::InputMedia
23    #[derive(Debug, Clone, Serialize)]
24    pub SendMediaGroup (SendMediaGroupSetters) => Vec<Message> {
25        required {
26            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
27            pub chat_id: Recipient [into],
28            /// A JSON-serialized array describing messages to be sent, must include 2-10 items
29            pub media: Vec<InputMedia> [collect],
30        }
31        optional {
32            /// Unique identifier of the business connection on behalf of which the message will be sent
33            pub business_connection_id: BusinessConnectionId,
34            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups 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            /// Sends the message [silently]. Users will receive a notification with no sound.
39            ///
40            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
41            pub disable_notification: bool,
42            /// Protects the contents of sent messages from forwarding and saving
43            pub protect_content: bool,
44            /// 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
45            pub allow_paid_broadcast: bool,
46            /// Unique identifier of the message effect to be added to the message; for private chats only
47            pub message_effect_id: EffectId,
48            /// Description of the message to reply to
49            pub reply_parameters: ReplyParameters,
50        }
51    }
52}