Skip to main content

telers/methods/
get_sticker_set.rs

1use crate::client::Bot;
2use serde::Serialize;
3/// Use this method to get a sticker set. On success, a [`crate::types::StickerSet`] object is returned.
4/// # Documentation
5/// <https://core.telegram.org/bots/api#getstickerset>
6/// # Returns
7/// - `crate::types::StickerSet`
8#[derive(Clone, Debug, Serialize)]
9pub struct GetStickerSet {
10    /// Name of the sticker set
11    pub name: Box<str>,
12}
13impl GetStickerSet {
14    /// Creates a new `GetStickerSet`.
15    ///
16    /// # Arguments
17    /// * `name` - Name of the sticker set
18    #[must_use]
19    pub fn new<T0: Into<Box<str>>>(name: T0) -> Self {
20        Self {
21            name: name.into(),
22        }
23    }
24
25    /// Name of the sticker set
26    #[must_use]
27    pub fn name<T: Into<Box<str>>>(self, val: T) -> Self {
28        let mut this = self;
29        this.name = val.into();
30        this
31    }
32}
33impl super::TelegramMethod for GetStickerSet {
34    type Method = Self;
35    type Return = crate::types::StickerSet;
36
37    fn build_request<Client>(self, _bot: &Bot<Client>) -> super::Request<Self::Method> {
38        super::Request::new("getStickerSet", self, None)
39    }
40}