teloxide_core_ng/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, ThreadId,
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 /// New start timestamp for the copied video in the message
31 pub video_start_timestamp: Seconds,
32 /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
33 pub caption: String [into],
34 /// Mode for parsing entities in the photo caption. See [formatting options] for more details.
35 ///
36 /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
37 pub parse_mode: ParseMode,
38 /// List of special entities that appear in the new caption, which can be specified instead of _parse\_mode_
39 pub caption_entities: Vec<MessageEntity> [collect],
40 /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified
41 pub show_caption_above_media: bool,
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 /// 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.
55 ///
56 /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
57 /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
58 pub reply_markup: ReplyMarkup [into],
59 }
60 }
61}