Struct tgbot::types::SendAnimation

source ·
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

source

pub fn new<A, B>(animation: A, chat_id: B) -> Self
where A: Into<InputFile>, B: Into<ChatId>,

Creates a new SendAnimation.

§Arguments
  • chat_id - Unique identifier of the target chat.
  • animation - Animation to send.
source

pub fn with_business_connection_id<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new business connection ID.

§Arguments
  • value - Unique identifier of the business connection.
source

pub fn with_caption<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new caption.

§Arguments
  • value - Caption; 0-1024 characters.

May also be used when resending animation by file_id.

source

pub fn with_caption_entities<T>(self, value: T) -> Result<Self, TextEntityError>
where T: IntoIterator<Item = TextEntity>,

Sets a new list of caption entities.

§Arguments
  • value - The list of special entities that appear in the caption.

Caption parse mode will be set to None when this method is called.

source

pub fn with_caption_parse_mode(self, value: ParseMode) -> Self

Sets a new caption parse mode.

§Arguments
  • value - Parse mode.

Caption entities will be set to None when this method is called.

source

pub fn with_disable_notification(self, value: bool) -> Self

Sets a new value for a disable_notification flag.

§Arguments
  • value - Indicates whether to send the message silently or not; a user will receive a notification without sound.
source

pub fn with_duration(self, value: Integer) -> Self

Sets a new duration.

§Arguments
  • value - Duration in seconds.
source

pub fn with_has_spoiler(self, value: bool) -> Self

Sets a new value for a has_spoiler flag.

§Arguments
  • value - Indicates whether to cover with a spoiler animation.
source

pub fn with_height(self, value: Integer) -> Self

Sets a new height.

§Arguments
  • value - Height.
source

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; supergroups only.
source

pub fn with_protect_content(self, value: bool) -> Self

Sets a new value for a protect_content flag.

§Arguments
  • value - Indicates whether to protect the contents of the sent message from forwarding and saving.
source

pub fn with_reply_markup<T>(self, value: T) -> Result<Self, ReplyMarkupError>
where T: Into<ReplyMarkup>,

Sets a new reply markup.

§Arguments
  • value - Reply markup.
source

pub fn with_reply_parameters( self, value: ReplyParameters ) -> Result<Self, ReplyParametersError>

Sets new reply parameters.

§Arguments
  • value - Description of the message to reply to.
source

pub fn with_thumbnail<T>(self, value: T) -> Result<Self, SendAnimationError>
where T: Into<InputFile>,

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.

source

pub fn with_width(self, value: Integer) -> Self

Sets a new width.

§Arguments
  • value - Width.

Trait Implementations§

source§

impl Debug for SendAnimation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Method for SendAnimation

§

type Response = Message

The type representing a successful result in an API response.
source§

fn into_payload(self) -> Payload

Converts the method into a payload for an HTTP request.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more