pub struct SendAnimation { /* private fields */ }Expand description
Sends an animation file (GIF or H.264/MPEG-4 AVC video without sound).
Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
Implementations§
Source§impl SendAnimation
impl SendAnimation
Sourcepub fn new<A, B>(animation: A, chat_id: B) -> Self
pub fn new<A, B>(animation: A, chat_id: B) -> Self
Creates a new SendAnimation.
§Arguments
chat_id- Unique identifier of the target chat.animation- Animation to send.
Sourcepub fn with_allow_paid_broadcast(self, value: bool) -> Self
pub fn with_allow_paid_broadcast(self, value: bool) -> Self
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_business_connection_id<T>(self, value: T) -> Self
pub fn with_business_connection_id<T>(self, value: T) -> Self
Sourcepub fn with_caption<T>(self, value: T) -> Self
pub fn with_caption<T>(self, value: T) -> Self
Sets a new caption.
§Arguments
value- Caption; 0-1024 characters.
May also be used when resending animation by file_id.
Sourcepub fn with_caption_entities<T>(self, value: T) -> Result<Self, TextEntityError>where
T: IntoIterator<Item = TextEntity>,
pub fn with_caption_entities<T>(self, value: T) -> Result<Self, TextEntityError>where
T: IntoIterator<Item = TextEntity>,
Sourcepub fn with_caption_parse_mode(self, value: ParseMode) -> Self
pub fn with_caption_parse_mode(self, value: ParseMode) -> Self
Sourcepub fn with_direct_messages_topic_id(self, value: Integer) -> Self
pub fn with_direct_messages_topic_id(self, value: Integer) -> Self
Sets a new direct messages topic ID
value- Identifier of the direct messages topic to which the message will be sent.
Required if the message is sent to a direct messages chat.
Sourcepub fn with_disable_notification(self, value: bool) -> Self
pub fn with_disable_notification(self, value: bool) -> Self
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_duration(self, value: Integer) -> Self
pub fn with_duration(self, value: Integer) -> Self
Sourcepub fn with_has_spoiler(self, value: bool) -> Self
pub fn with_has_spoiler(self, value: bool) -> Self
Sets a new value for the has_spoiler flag.
§Arguments
value- Indicates whether to cover with a spoiler animation.
Sourcepub fn with_height(self, value: Integer) -> Self
pub fn with_height(self, value: Integer) -> Self
Sourcepub fn with_message_effect_id<T>(self, value: T) -> Self
pub fn with_message_effect_id<T>(self, value: T) -> Self
Sets a new message effect ID.
§Arguments
value- Unique identifier of the message effect to be added to the message; for private chats only.
Sourcepub fn with_message_thread_id(self, value: Integer) -> Self
pub fn with_message_thread_id(self, value: Integer) -> Self
Sets a new message thread ID.
§Arguments
value- Unique identifier of the target message thread; for forum supergroups and private chats of bots with forum topic mode enabled only.
Sourcepub fn with_protect_content(self, value: bool) -> Self
pub fn with_protect_content(self, value: bool) -> Self
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) -> Result<Self, ReplyMarkupError>where
T: Into<ReplyMarkup>,
pub fn with_reply_markup<T>(self, value: T) -> Result<Self, ReplyMarkupError>where
T: Into<ReplyMarkup>,
Sourcepub fn with_reply_parameters(
self,
value: ReplyParameters,
) -> Result<Self, ReplyParametersError>
pub fn with_reply_parameters( self, value: ReplyParameters, ) -> Result<Self, ReplyParametersError>
Sourcepub fn with_show_caption_above_media(self, value: bool) -> Self
pub fn with_show_caption_above_media(self, value: bool) -> Self
Sets a new value for the show_caption_above_media flag.
§Arguments
value - Whether the caption must be shown above the message media.
Sourcepub fn with_suggested_post_parameters(
self,
value: &SuggestedPostParameters,
) -> Result<Self, SuggestedPostParametersError>
pub fn with_suggested_post_parameters( self, value: &SuggestedPostParameters, ) -> Result<Self, SuggestedPostParametersError>
Sets a new suggested post parameters.
§Arguments
value- 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.
Sourcepub fn with_thumbnail<T>(self, value: T) -> Result<Self, SendAnimationError>
pub fn with_thumbnail<T>(self, value: T) -> Result<Self, SendAnimationError>
Sets a new thumbnail.
§Arguments
value- Thumbnail.
The thumbnail should be in JPEG format and less than 200 kB in size.
A thumbnail‘s width and height should not exceed 320.
Ignored if the file is not uploaded using multipart/form-data.
Thumbnails can’t be reused and can be only uploaded as a new file.