1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use crate::client::Bot;
use serde::Serialize;
/// Use this method to set the thumbnail of a custom emoji sticker set. Returns `true` on success.
/// # Documentation
/// <https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail>
/// # Returns
/// - `bool`
#[derive(Clone, Debug, Serialize)]
pub struct SetCustomEmojiStickerSetThumbnail {
/// Sticker set name
pub name: Box<str>,
/// Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_emoji_id: Option<Box<str>>,
}
impl SetCustomEmojiStickerSetThumbnail {
/// Creates a new `SetCustomEmojiStickerSetThumbnail`.
///
/// # Arguments
/// * `name` - Sticker set name
///
/// # Notes
/// Use builder methods to set optional fields.
#[must_use]
pub fn new<T0: Into<Box<str>>>(name: T0) -> Self {
Self {
name: name.into(),
custom_emoji_id: None,
}
}
/// Sticker set name
#[must_use]
pub fn name<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.name = val.into();
this
}
/// Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.
#[must_use]
pub fn custom_emoji_id<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.custom_emoji_id = Some(val.into());
this
}
/// Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.
#[must_use]
pub fn custom_emoji_id_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.custom_emoji_id = val.map(Into::into);
this
}
}
impl super::TelegramMethod for SetCustomEmojiStickerSetThumbnail {
type Method = Self;
type Return = bool;
fn build_request<Client>(self, _bot: &Bot<Client>) -> super::Request<Self::Method> {
super::Request::new("setCustomEmojiStickerSetThumbnail", self, None)
}
}