Skip to main content

ronami_core/payloads/
forward_messages.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::MessageId;
6use crate::types::Recipient;
7use crate::types::ThreadId;
8use crate::types::TopicId;
9
10impl_payload! {
11    /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of [`MessageId`] of the sent messages is returned.
12    ///
13    /// [`MessageId`]: crate::types::MessageId
14    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
15    pub ForwardMessages (ForwardMessagesSetters) => Vec<MessageId> {
16        required {
17            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
18            pub chat_id: Recipient [into],
19            /// Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`)
20            pub from_chat_id: Recipient [into],
21            /// A JSON-serialized list of 1-100 identifiers of messages in the chat _from\_chat\_id_ to forward. The identifiers must be specified in a strictly increasing order.
22            #[serde(with = "crate::types::vec_msg_id_as_vec_int")]
23            pub message_ids: Vec<MessageId> [collect],
24        }
25        optional {
26            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
27            pub message_thread_id: ThreadId,
28            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
29            pub direct_messages_topic_id: TopicId,
30            /// Sends the message [silently]. Users will receive a notification with no sound.
31            ///
32            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
33            pub disable_notification: bool,
34            /// Protects the contents of sent messages from forwarding and saving
35            pub protect_content: bool,
36        }
37    }
38}