Add format field to InputSticker struct

This commit is contained in:
Akshett Rai Jindal 2024-08-20 20:50:47 +05:30
parent 924affbdde
commit 590d46477f
2 changed files with 8 additions and 1 deletions

View file

@ -90,7 +90,7 @@ mod tests {
types::{
ChatId, InputFile, InputMedia, InputMediaAnimation, InputMediaAudio,
InputMediaDocument, InputMediaPhoto, InputMediaVideo, InputSticker, MessageEntity,
MessageEntityKind, ParseMode, UserId,
MessageEntityKind, ParseMode, StickerFormat, UserId,
},
};
@ -157,6 +157,7 @@ mod tests {
emoji_list: vec!["✈️⚙️".to_owned()],
keywords: vec![],
mask_position: None,
format: StickerFormat::Static,
},
))
.unwrap()

View file

@ -2,6 +2,8 @@ use serde::Serialize;
use crate::types::{InputFile, MaskPosition};
use super::StickerFormat;
/// This object describes a sticker to be added to a sticker set.
#[serde_with::skip_serializing_none]
#[derive(Clone, Debug, Serialize)]
@ -16,6 +18,10 @@ pub struct InputSticker {
/// More information on Sending Files <https://core.telegram.org/bots/api#sending-files>
pub sticker: InputFile,
/// Format of the added sticker, must be one of "static" for a .WEBP or .PNG
/// image, "animated" for a .TGS animation, "video" for a WEBM video
pub format: StickerFormat,
/// List of 1-20 emoji associated with the sticker
pub emoji_list: Vec<String>,