pub struct StickerBuilder {Show 15 fields
pub file_id: String,
pub file_unique_id: String,
pub tg_type: String,
pub width: i64,
pub height: i64,
pub is_animated: bool,
pub is_video: bool,
pub thumbnail: Option<BoxWrapper<Unbox<PhotoSize>>>,
pub emoji: Option<String>,
pub set_name: Option<String>,
pub premium_animation: Option<BoxWrapper<Unbox<File>>>,
pub mask_position: Option<BoxWrapper<Unbox<MaskPosition>>>,
pub custom_emoji_id: Option<String>,
pub needs_repainting: Option<bool>,
pub file_size: Option<i64>,
}Expand description
This object represents a sticker.
Fields§
§file_id: StringIdentifier for this file, which can be used to download or reuse the file
file_unique_id: StringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
tg_type: StringType of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.
width: i64Sticker width
height: i64Sticker height
is_animated: boolTrue, if the sticker is animated
is_video: boolTrue, if the sticker is a video sticker
thumbnail: Option<BoxWrapper<Unbox<PhotoSize>>>Optional. Sticker thumbnail in the .WEBP or .JPG format
emoji: Option<String>Optional. Emoji associated with the sticker
set_name: Option<String>Optional. Name of the sticker set to which the sticker belongs
Optional. For premium regular stickers, premium animation for the sticker
mask_position: Option<BoxWrapper<Unbox<MaskPosition>>>Optional. For mask stickers, the position where the mask should be placed
custom_emoji_id: Option<String>Optional. For custom emoji stickers, unique identifier of the custom emoji
needs_repainting: Option<bool>Optional. True, if 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
file_size: Option<i64>Optional. File size in bytes
Implementations§
Source§impl StickerBuilder
impl StickerBuilder
pub fn new( file_id: String, file_unique_id: String, width: i64, height: i64, is_animated: bool, is_video: bool, ) -> Self
Sourcepub fn set_file_id(self, file_id: String) -> Self
pub fn set_file_id(self, file_id: String) -> Self
Identifier for this file, which can be used to download or reuse the file
Sourcepub fn set_file_unique_id(self, file_unique_id: String) -> Self
pub fn set_file_unique_id(self, file_unique_id: String) -> Self
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
Sourcepub fn set_type(self, tg_type: String) -> Self
pub fn set_type(self, tg_type: String) -> Self
Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.
Sourcepub fn set_height(self, height: i64) -> Self
pub fn set_height(self, height: i64) -> Self
Sticker height
Sourcepub fn set_is_animated(self, is_animated: bool) -> Self
pub fn set_is_animated(self, is_animated: bool) -> Self
True, if the sticker is animated
Sourcepub fn set_is_video(self, is_video: bool) -> Self
pub fn set_is_video(self, is_video: bool) -> Self
True, if the sticker is a video sticker
Sourcepub fn set_thumbnail(self, thumbnail: PhotoSize) -> Self
pub fn set_thumbnail(self, thumbnail: PhotoSize) -> Self
Optional. Sticker thumbnail in the .WEBP or .JPG format
Sourcepub fn set_set_name(self, set_name: String) -> Self
pub fn set_set_name(self, set_name: String) -> Self
Optional. Name of the sticker set to which the sticker belongs
Optional. For premium regular stickers, premium animation for the sticker
Sourcepub fn set_mask_position(self, mask_position: MaskPosition) -> Self
pub fn set_mask_position(self, mask_position: MaskPosition) -> Self
Optional. For mask stickers, the position where the mask should be placed
Sourcepub fn set_custom_emoji_id(self, custom_emoji_id: String) -> Self
pub fn set_custom_emoji_id(self, custom_emoji_id: String) -> Self
Optional. For custom emoji stickers, unique identifier of the custom emoji
Sourcepub fn set_needs_repainting(self, needs_repainting: bool) -> Self
pub fn set_needs_repainting(self, needs_repainting: bool) -> Self
Optional. True, if 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
Sourcepub fn set_file_size(self, file_size: i64) -> Self
pub fn set_file_size(self, file_size: i64) -> Self
Optional. File size in bytes
pub fn build(self) -> Sticker
Trait Implementations§
Source§impl Clone for StickerBuilder
impl Clone for StickerBuilder
Source§fn clone(&self) -> StickerBuilder
fn clone(&self) -> StickerBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StickerBuilder
impl Debug for StickerBuilder
Source§impl Default for StickerBuilder
impl Default for StickerBuilder
Source§fn default() -> StickerBuilder
fn default() -> StickerBuilder
Source§impl<'de> Deserialize<'de> for StickerBuilder
impl<'de> Deserialize<'de> for StickerBuilder
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 Hash for StickerBuilder
impl Hash for StickerBuilder
Source§impl Ord for StickerBuilder
impl Ord for StickerBuilder
Source§fn cmp(&self, other: &StickerBuilder) -> Ordering
fn cmp(&self, other: &StickerBuilder) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for StickerBuilder
impl PartialEq for StickerBuilder
Source§impl PartialOrd for StickerBuilder
impl PartialOrd for StickerBuilder
Source§impl Serialize for StickerBuilder
impl Serialize for StickerBuilder
impl Eq for StickerBuilder
impl StructuralPartialEq for StickerBuilder
Auto Trait Implementations§
impl Freeze for StickerBuilder
impl RefUnwindSafe for StickerBuilder
impl Send for StickerBuilder
impl Sync for StickerBuilder
impl Unpin for StickerBuilder
impl UnsafeUnpin for StickerBuilder
impl UnwindSafe for StickerBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.