Skip to main content

ronami_core/payloads/
copy_message.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    EffectId, MessageEntity, MessageId, ParseMode, Recipient, ReplyMarkup, ReplyParameters,
7    Seconds, SuggestedPostParameters, ThreadId, TopicId,
8};
9
10impl_payload! {
11    /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz [`Poll`] can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method [`ForwardMessage`], but the copied message doesn't have a link to the original message. Returns the [`MessageId`] of the sent message on success.
12    ///
13    /// [`Poll`]: crate::types::Poll
14    /// [`MessageId`]: crate::types::MessageId
15    /// [`ForwardMessage`]: crate::payloads::ForwardMessage
16    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
17    pub CopyMessage (CopyMessageSetters) => MessageId {
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            /// Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`)
22            pub from_chat_id: Recipient [into],
23            /// Message identifier in the chat specified in _from\_chat\_id_
24            #[serde(flatten)]
25            pub message_id: MessageId,
26        }
27        optional {
28            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
29            pub message_thread_id: ThreadId,
30            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
31            pub direct_messages_topic_id: TopicId,
32            /// New start timestamp for the copied video in the message
33            pub video_start_timestamp: Seconds,
34            /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
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 new 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. Ignored if a new caption isn't specified
43            pub show_caption_above_media: bool,
44            /// Sends the message [silently]. Users will receive a notification with no sound.
45            ///
46            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
47            pub disable_notification: bool,
48            /// Protects the contents of sent messages from forwarding and saving
49            pub protect_content: bool,
50            /// 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
51            pub allow_paid_broadcast: bool,
52            /// Unique identifier of the message effect to be added to the message; for private chats only
53            pub message_effect_id: EffectId,
54            /// 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.
55            pub suggested_post_parameters: SuggestedPostParameters,
56            /// Description of the message to reply to
57            pub reply_parameters: ReplyParameters,
58            /// 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.
59            ///
60            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
61            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
62            pub reply_markup: ReplyMarkup [into],
63        }
64    }
65}