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.
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
impl Sticker
sourcepub fn new<A, B>(
file_id: A,
file_unique_id: B,
sticker_type: StickerType,
height: Integer,
width: Integer
) -> Self
pub fn new<A, B>( file_id: A, file_unique_id: B, sticker_type: StickerType, height: Integer, width: Integer ) -> Self
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.
sourcepub fn with_is_animated(self, value: bool) -> Self
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.
sourcepub fn with_is_video(self, value: bool) -> Self
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.
sourcepub fn with_custom_emoji_id<T>(self, value: T) -> Self
pub fn with_custom_emoji_id<T>(self, value: T) -> Self
sourcepub fn with_emoji<T>(self, value: T) -> Self
pub fn with_emoji<T>(self, value: T) -> Self
sourcepub fn with_file_size(self, value: Integer) -> Self
pub fn with_file_size(self, value: Integer) -> Self
sourcepub fn with_mask_position(self, value: MaskPosition) -> Self
pub fn with_mask_position(self, value: MaskPosition) -> Self
sourcepub fn with_needs_repainting(self, value: bool) -> Self
pub fn with_needs_repainting(self, value: bool) -> Self
sourcepub fn with_set_name<T>(self, value: T) -> Self
pub fn with_set_name<T>(self, value: T) -> Self
sourcepub fn with_thumbnail(self, value: PhotoSize) -> Self
pub fn with_thumbnail(self, value: PhotoSize) -> Self
Trait Implementations§
source§impl<'de> Deserialize<'de> for Sticker
impl<'de> Deserialize<'de> for Sticker
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<Sticker> for ExternalReplyData
impl From<Sticker> for ExternalReplyData
source§fn from(original: Sticker) -> ExternalReplyData
fn from(original: Sticker) -> ExternalReplyData
source§impl PartialEq for Sticker
impl PartialEq for Sticker
source§impl PartialOrd for Sticker
impl PartialOrd for Sticker
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for Sticker
Auto Trait Implementations§
impl Freeze for Sticker
impl RefUnwindSafe for Sticker
impl Send for Sticker
impl Sync for Sticker
impl Unpin for Sticker
impl UnwindSafe for Sticker
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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