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::BusinessConnectionId;
6use crate::types::EffectId;
7use crate::types::InputMedia;
8use crate::types::Message;
9use crate::types::Recipient;
10use crate::types::ReplyParameters;
11use crate::types::ThreadId;
12use crate::types::TopicId;
13
14impl_payload! {
15    /// 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.
16    ///
17    /// ## Captions
18    ///
19    /// 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.
20    ///
21    /// 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.
22    ///
23    /// 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).
24    ///
25    /// [`Message`]: crate::types::Message
26    /// [`InputMedia`]: crate::types::InputMedia
27    #[derive(Debug, Clone, Serialize)]
28    pub SendMediaGroup (SendMediaGroupSetters) => Vec<Message> {
29        required {
30            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
31            pub chat_id: Recipient [into],
32            /// A JSON-serialized array describing messages to be sent, must include 2-10 items
33            pub media: Vec<InputMedia> [collect],
34        }
35        optional {
36            /// Unique identifier of the business connection on behalf of which the message will be sent
37            pub business_connection_id: BusinessConnectionId,
38            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
39            pub message_thread_id: ThreadId,
40            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
41            pub direct_messages_topic_id: TopicId,
42            /// Sends the message [silently]. Users will receive a notification with no sound.
43            ///
44            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
45            pub disable_notification: bool,
46            /// Protects the contents of sent messages from forwarding and saving
47            pub protect_content: bool,
48            /// 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
49            pub allow_paid_broadcast: bool,
50            /// Unique identifier of the message effect to be added to the message; for private chats only
51            pub message_effect_id: EffectId,
52            /// Description of the message to reply to
53            pub reply_parameters: ReplyParameters,
54        }
55    }
56}