pub struct Sticker {Show 15 fields
pub file_id: String,
pub file_unique_id: String,
pub height: i64,
pub is_animated: bool,
pub is_video: bool,
pub sticker_type: StickerType,
pub width: i64,
pub custom_emoji_id: Option<String>,
pub emoji: Option<String>,
pub file_size: Option<i64>,
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: i64
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: i64
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<i64>
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: i64,
width: i64
) -> Sticker
pub fn new<A, B>( file_id: A, file_unique_id: B, sticker_type: StickerType, height: i64, width: i64 ) -> Sticker
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) -> Sticker
pub fn with_is_animated(self, value: bool) -> Sticker
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) -> Sticker
pub fn with_is_video(self, value: bool) -> Sticker
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) -> Sticker
pub fn with_custom_emoji_id<T>(self, value: T) -> Sticker
sourcepub fn with_emoji<T>(self, value: T) -> Sticker
pub fn with_emoji<T>(self, value: T) -> Sticker
sourcepub fn with_file_size(self, value: i64) -> Sticker
pub fn with_file_size(self, value: i64) -> Sticker
sourcepub fn with_mask_position(self, value: MaskPosition) -> Sticker
pub fn with_mask_position(self, value: MaskPosition) -> Sticker
sourcepub fn with_needs_repainting(self, value: bool) -> Sticker
pub fn with_needs_repainting(self, value: bool) -> Sticker
sourcepub fn with_set_name<T>(self, value: T) -> Sticker
pub fn with_set_name<T>(self, value: T) -> Sticker
sourcepub fn with_thumbnail(self, value: PhotoSize) -> Sticker
pub fn with_thumbnail(self, value: PhotoSize) -> Sticker
Trait Implementations§
source§impl<'de> Deserialize<'de> for Sticker
impl<'de> Deserialize<'de> for Sticker
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Sticker, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Sticker, <__D as Deserializer<'de>>::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 moresource§impl Serialize for Sticker
impl Serialize for Sticker
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl 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