pub struct CopyMessage { /* private fields */ }
Expand description
Copies a message.
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.
Implementations§
Source§impl CopyMessage
impl CopyMessage
Sourcepub fn new<A, B>(chat_id: A, from_chat_id: B, message_id: i64) -> CopyMessage
pub fn new<A, B>(chat_id: A, from_chat_id: B, message_id: i64) -> CopyMessage
Creates a new CopyMessage
.
§Arguments
chat_id
- Unique identifier of the target chat.from_chat_id
- Unique identifier of the chat where the original message was sent.message_id
- Message identifier in the chat specified infrom_chat_id
.
Sourcepub fn with_allow_paid_broadcast(self, value: bool) -> CopyMessage
pub fn with_allow_paid_broadcast(self, value: bool) -> CopyMessage
Sets a new value for the allow_paid_broadcast
flag.
§Arguments
value
- Whether 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.
Sourcepub fn with_caption<T>(self, value: T) -> CopyMessage
pub fn with_caption<T>(self, value: T) -> CopyMessage
Sets a new caption.
§Arguments
value
- Caption; 0-1024 characters after entities parsing.
If not specified, the original caption is kept.
Sourcepub fn with_caption_entities<T>(self, value: T) -> CopyMessagewhere
T: IntoIterator<Item = TextEntity>,
pub fn with_caption_entities<T>(self, value: T) -> CopyMessagewhere
T: IntoIterator<Item = TextEntity>,
Sourcepub fn with_caption_parse_mode(self, value: ParseMode) -> CopyMessage
pub fn with_caption_parse_mode(self, value: ParseMode) -> CopyMessage
Sourcepub fn with_disable_notification(self, value: bool) -> CopyMessage
pub fn with_disable_notification(self, value: bool) -> CopyMessage
Sets a new value for the disable_notification
flag.
§Arguments
value
- Indicates whether to send the message silently or not; a user will receive a notification without sound.
Sourcepub fn with_message_thread_id(self, value: i64) -> CopyMessage
pub fn with_message_thread_id(self, value: i64) -> CopyMessage
Sets a new message thread ID.
§Arguments
value
- Unique identifier of the target message thread; supergroups only.
Sourcepub fn with_protect_content(self, value: bool) -> CopyMessage
pub fn with_protect_content(self, value: bool) -> CopyMessage
Sets a new value for the protect_content
flag.
§Arguments
value
- Indicates whether to protect the contents of the sent message from forwarding and saving.
Sourcepub fn with_reply_markup<T>(self, value: T) -> CopyMessagewhere
T: Into<ReplyMarkup>,
pub fn with_reply_markup<T>(self, value: T) -> CopyMessagewhere
T: Into<ReplyMarkup>,
Sourcepub fn with_reply_parameters(self, value: ReplyParameters) -> CopyMessage
pub fn with_reply_parameters(self, value: ReplyParameters) -> CopyMessage
Sourcepub fn with_show_caption_above_media(self, value: bool) -> CopyMessage
pub fn with_show_caption_above_media(self, value: bool) -> CopyMessage
Sets a new value for the show_caption_above_media
flag.
§Arguments
value
- Whether the caption must be shown above the message media;
ignored if a new caption isn’t specified.
Sourcepub fn with_video_start_timestamp(self, value: i64) -> CopyMessage
pub fn with_video_start_timestamp(self, value: i64) -> CopyMessage
Sets a new video start timestamp.
§Arguments
value
- New start timestamp for the copied video in the message.
Trait Implementations§
Source§impl Clone for CopyMessage
impl Clone for CopyMessage
Source§fn clone(&self) -> CopyMessage
fn clone(&self) -> CopyMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more