tg_flows/types/
input_sticker.rs

1use serde::Serialize;
2
3use crate::types::InputFile;
4
5/// Sticker file that may be uploaded to telegram.
6#[derive(Clone, Debug, Serialize)]
7pub enum InputSticker {
8    /// PNG image with the sticker, must be up to 512 kilobytes in size,
9    /// dimensions must not exceed 512px, and either width or height must be
10    /// exactly 512px.
11    ///
12    /// Pass [`InputFile::file_id`] to send a file that exists on
13    /// the Telegram servers (recommended), pass an [`InputFile::url`] for
14    /// Telegram to get a .webp file from the Internet, or upload a new one
15    /// using [`InputFile::file`], [`InputFile::memory`] or [`InputFile::read`].
16    /// [More info on Sending Files »].
17    ///
18    /// [`InputFile::file_id`]: InputFile::file_id
19    /// [`InputFile::url`]: InputFile::url
20    /// [`InputFile::file`]: InputFile::file
21    /// [`InputFile::memory`]: InputFile::memory
22    /// [`InputFile::read`]: InputFile::read
23    ///
24    /// [More info on Sending Files »]: https://core.telegram.org/bots/api#sending-files
25    #[serde(rename = "png_sticker")]
26    Png(InputFile),
27
28    /// TGS animation with the sticker, uploaded using multipart/form-data.
29    ///
30    /// See <https://core.telegram.org/animated_stickers#technical-requirements> for technical requirements.
31    #[serde(rename = "tgs_sticker")]
32    Tgs(InputFile),
33
34    /// WEBM video with the sticker, uploaded using multipart/form-data.
35    ///
36    /// See <https://core.telegram.org/stickers#video-sticker-requirements> for technical requirements.
37    #[serde(rename = "webm_sticker")]
38    Webm(InputFile),
39}