pub struct CopyOptions {Show 18 fields
pub silent: bool,
pub background: bool,
pub drop_captions: bool,
pub noforwards: bool,
pub reply_to: Option<i32>,
pub topic_id: Option<i32>,
pub schedule_date: Option<i32>,
pub schedule_repeat_period: Option<i32>,
pub send_as: Option<PeerRef>,
pub effect: Option<i64>,
pub video_timestamp: Option<i32>,
pub allow_paid_stars: Option<i64>,
pub allow_paid_floodskip: bool,
pub quick_reply_shortcut: Option<InputQuickReplyShortcut>,
pub suggested_post: Option<SuggestedPost>,
pub caption: Option<String>,
pub caption_entities: Option<Vec<MessageEntity>>,
pub reply_markup: Option<ReplyMarkup>,
}Expand description
Options for copying messages (forward without the “Forwarded from” attribution).
Used by crate::Client::copy_messages and IncomingMessage::copy. This
is the same underlying messages.forwardMessages call as
ForwardOptions, with drop_author always forced to true - which is
exactly what Telegram’s own “copy” feature does under the hood.
Fields§
§silent: boolSend silently (no notification for recipient).
background: boolSend as a background message (doesn’t bump the chat to the top).
drop_captions: boolRemove captions from copied media. Honored on both the cheap forward
path (via drop_media_captions) and the fetch-and-resend override
path - the latter only when caption is left None; an explicit
caption always wins over this flag.
noforwards: boolPrevent recipients from forwarding the message further.
reply_to: Option<i32>Reply to an existing message in the destination chat.
topic_id: Option<i32>Copy into this forum topic thread (the top_msg_id of the topic,
see crate::Client::get_forum_topics).
schedule_date: Option<i32>Schedule the copy for this Unix timestamp (seconds).
schedule_repeat_period: Option<i32>Repeat the scheduled copy every N seconds. Only meaningful with
schedule_date set.
send_as: Option<PeerRef>Send as a different identity you’re allowed to send as (e.g. an anonymous admin identity, or a linked channel) instead of yourself.
effect: Option<i64>Attach a message effect (Premium sticker/emoji effect) by its ID.
video_timestamp: Option<i32>Start the copied video’s preview at this timestamp (seconds).
allow_paid_stars: Option<i64>Stars you’re willing to pay if the destination charges for messages.
allow_paid_floodskip: boolBypass paid-messages flood limits by paying Stars.
quick_reply_shortcut: Option<InputQuickReplyShortcut>Associate the copy with a business-account quick reply shortcut.
suggested_post: Option<SuggestedPost>Send as a channel “suggested post” instead of posting directly.
caption: Option<String>Replace the copy’s text/caption instead of keeping the original.
Setting this (or CopyOptions::reply_markup) routes the copy
through crate::Client::copy_message’s fetch-and-resend path
instead of the cheap forward_messages path: raw MTProto’s
messages.forwardMessages has no field to override text or
caption, only drop_media_captions (keep or strip, nothing else),
so an override can only be done by fetching the source message and
sending its media as a brand-new message - the same way Telegram’s
own Bot API implements copyMessage under the hood.
When left None, the source message’s own text/caption is kept -
and its formatting entities (bold, italic, links, code, spoilers,
…) are carried over with it. Set CopyOptions::caption_entities
alongside this field to give a new caption its own formatting.
caption_entities: Option<Vec<MessageEntity>>Formatting entities for CopyOptions::caption. Ignored unless
caption is also set - when caption is None, the source
message’s own entities are used instead, so there’s nothing to
override here.
reply_markup: Option<ReplyMarkup>Attach a reply markup to the copy instead of sending it bare.
Unlike Telegram’s Bot API, this never falls back to the source
message’s own reply markup when left None - buttons are commonly
tied to the original bot’s callback handlers, so silently carrying
them over to a copy sent by a different client would produce dead
buttons. Pass the source’s markup explicitly if you want to keep it.
Also routes through the fetch-and-resend path; see
CopyOptions::caption.
Trait Implementations§
Source§impl Clone for CopyOptions
impl Clone for CopyOptions
Source§fn clone(&self) -> CopyOptions
fn clone(&self) -> CopyOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more