pub struct CopyMessageBuilder<'a> {
pub chat_id: i64,
pub message_thread_id: Option<i64>,
pub from_chat_id: i64,
pub message_id: i64,
pub caption: Option<String>,
pub parse_mode: Option<String>,
pub caption_entities: Option<Vec<MessageEntity>>,
pub show_caption_above_media: Option<bool>,
pub disable_notification: Option<bool>,
pub protect_content: Option<bool>,
pub reply_parameters: Option<ReplyParameters>,
pub reply_markup: Option<InlineKeyboardMarkup>,
/* private fields */
}Fields§
§chat_id: i64Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_thread_id: Option<i64>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
from_chat_id: i64Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
message_id: i64Message identifier in the chat specified in from_chat_id
caption: Option<String>New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
parse_mode: Option<String>Mode for parsing entities in the new caption. See formatting options for more details.
caption_entities: Option<Vec<MessageEntity>>A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
show_caption_above_media: Option<bool>Pass True, if the caption must be shown above the message media. Ignored if a new caption isn’t specified.
disable_notification: Option<bool>Sends the message silently. Users will receive a notification with no sound.
protect_content: Option<bool>Protects the contents of the sent message from forwarding and saving
reply_parameters: Option<ReplyParameters>Description of the message to reply to
reply_markup: Option<InlineKeyboardMarkup>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
Implementations§
Source§impl<'a> CopyMessageBuilder<'a>
impl<'a> CopyMessageBuilder<'a>
pub fn new( bot: &'a Bot, chat_id: i64, from_chat_id: i64, message_id: i64, ) -> Self
pub fn chat_id(self, chat_id: i64) -> Self
pub fn message_thread_id(self, message_thread_id: i64) -> Self
pub fn from_chat_id(self, from_chat_id: i64) -> Self
pub fn message_id(self, message_id: i64) -> Self
pub fn caption(self, caption: String) -> Self
pub fn parse_mode(self, parse_mode: String) -> Self
pub fn caption_entities(self, caption_entities: Vec<MessageEntity>) -> Self
pub fn show_caption_above_media(self, show_caption_above_media: bool) -> Self
pub fn disable_notification(self, disable_notification: bool) -> Self
pub fn protect_content(self, protect_content: bool) -> Self
pub fn reply_parameters(self, reply_parameters: ReplyParameters) -> Self
pub fn reply_markup(self, reply_markup: InlineKeyboardMarkup) -> Self
Sourcepub async fn send(self) -> Result<MessageId>
pub async fn send(self) -> Result<MessageId>
Examples found in repository?
76async fn echo(bot: Bot, ctx: Context) -> Result<GroupIteration> {
77 // Command Handler recieves message updates which have chat as a compulsory field.
78 // Hence we can unwrap effective chat without checking if it is none.
79 let chat = ctx.effective_chat.unwrap();
80 // Same logic as chat applies on unwrapping effective message here.
81 let msg = ctx.effective_message.unwrap();
82 // Every api method creates a builder which contains various parameters of that respective method.
83 bot.copy_message(chat.id, chat.id, msg.message_id)
84 // You must use this send() method in order to send the request to the API
85 .send()
86 .await?;
87
88 // GroupIteration::EndGroups will end iteration of groups for an update.
89 // This means that rest of the pending groups and their handlers won't be checked
90 // for this particular update.
91 Ok(GroupIteration::EndGroups)
92}