teloxide_core/payloads/
copy_message.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    MessageEntity, MessageId, ParseMode, Recipient, ReplyMarkup, ReplyParameters, Seconds, ThreadId,
7};
8
9impl_payload! {
10    /// 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.
11    ///
12    /// [`Poll`]: crate::types::Poll
13    /// [`MessageId`]: crate::types::MessageId
14    /// [`ForwardMessage`]: crate::payloads::ForwardMessage
15    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
16    pub CopyMessage (CopyMessageSetters) => MessageId {
17        required {
18            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
19            pub chat_id: Recipient [into],
20            /// Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`)
21            pub from_chat_id: Recipient [into],
22            /// Message identifier in the chat specified in _from\_chat\_id_
23            #[serde(flatten)]
24            pub message_id: MessageId,
25        }
26        optional {
27            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
28            pub message_thread_id: ThreadId,
29            /// New start timestamp for the copied video in the message
30            pub video_start_timestamp: Seconds,
31            /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
32            pub caption: String [into],
33            /// Mode for parsing entities in the photo caption. See [formatting options] for more details.
34            ///
35            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
36            pub parse_mode: ParseMode,
37            /// List of special entities that appear in the new caption, which can be specified instead of _parse\_mode_
38            pub caption_entities: Vec<MessageEntity> [collect],
39            /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified
40            pub show_caption_above_media: bool,
41            /// Sends the message [silently]. Users will receive a notification with no sound.
42            ///
43            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
44            pub disable_notification: bool,
45            /// Protects the contents of sent messages from forwarding and saving
46            pub protect_content: bool,
47            /// 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
48            pub allow_paid_broadcast: bool,
49            /// Description of the message to reply to
50            pub reply_parameters: ReplyParameters,
51            /// 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.
52            ///
53            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
54            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
55            pub reply_markup: ReplyMarkup [into],
56        }
57    }
58}