Struct tgbot::types::Sticker

source ·
pub struct Sticker {
Show 15 fields pub file_id: String, pub file_unique_id: String, pub height: Integer, pub is_animated: bool, pub is_video: bool, pub sticker_type: StickerType, pub width: Integer, pub custom_emoji_id: Option<String>, pub emoji: Option<String>, pub file_size: Option<Integer>, pub mask_position: Option<MaskPosition>, pub needs_repainting: Option<bool>, pub premium_animation: Option<File>, pub set_name: Option<String>, pub thumbnail: Option<PhotoSize>,
}
Expand description

Represents a sticker.

Fields§

§file_id: String

Identifier of the file.

Can be used to download or reuse the file.

§file_unique_id: String

Unique identifier of the file.

It is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

§height: Integer

Sticker height.

§is_animated: bool

Indicates whether the sticker is animated.

§is_video: bool

Indicates whether the sticker is a video sticker.

§sticker_type: StickerType

Type of the sticker.

The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.

§width: Integer

Sticker width.

§custom_emoji_id: Option<String>

For custom emoji stickers, unique identifier of the custom emoji.

§emoji: Option<String>

Emoji associated with the sticker.

§file_size: Option<Integer>

File size in bytes.

§mask_position: Option<MaskPosition>

For mask stickers, the position where the mask should be placed.

§needs_repainting: Option<bool>

Indicates whether the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places.

§premium_animation: Option<File>

For premium regular stickers, premium animation for the sticker.

§set_name: Option<String>

Name of the sticker set to which the sticker belongs.

§thumbnail: Option<PhotoSize>

Sticker thumbnail in the WEBP or JPEG format.

Implementations§

source§

impl Sticker

source

pub fn new<A, B>( file_id: A, file_unique_id: B, sticker_type: StickerType, height: Integer, width: Integer ) -> Self
where A: Into<String>, B: Into<String>,

Creates a new Sticker.

§Arguments
  • file_id - Identifier for the file.
  • file_unique_id - Unique identifier for the file.
  • sticker_type - Type of the sticker.
  • height - Sticker height.
  • width - Sticker width.
source

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

Sets a new value for an is_animated flag.

§Arguments
  • value - Indicates whether the sticker is animated.
source

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

Sets a new value for an is_video flag.

§Arguments
  • value - Indicates whether the sticker is a video sticker.
source

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

Sets a new custom emoji ID.

§Arguments
  • value - Custom emoji ID.
source

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

Sets a new emoji.

§Arguments
  • value - Emoji.
source

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

Sets a new file size.

§Arguments
  • value - File size in bytes.
source

pub fn with_mask_position(self, value: MaskPosition) -> Self

Sets a new mask position.

§Arguments
  • value - Mask position.
source

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

Sets a new value for a needs_repainting flag.

§Arguments
  • value - Value of the flag.
source

pub fn with_premium_animation(self, value: File) -> Self

Sets a new premium animation.

§Arguments
  • value - Premium animation.
source

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

Sets a new sticker set name.

§Arguments
  • value - Name of a sticker set.
source

pub fn with_thumbnail(self, value: PhotoSize) -> Self

Sets a new thumbnail.

§Arguments
  • value - Thumbnail.

Trait Implementations§

source§

impl Clone for Sticker

source§

fn clone(&self) -> Sticker

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Sticker

source§

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

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

impl<'de> Deserialize<'de> for Sticker

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Sticker> for ExternalReplyData

source§

fn from(original: Sticker) -> ExternalReplyData

Converts to this type from the input type.
source§

impl PartialEq for Sticker

source§

fn eq(&self, other: &Sticker) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Sticker

source§

fn partial_cmp(&self, other: &Sticker) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Sticker

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Sticker

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> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,