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