telers 1.0.0-beta.2

An asynchronous framework for Telegram Bot API written in Rust
Documentation
use serde::{Deserialize, Serialize};
/// This object represents a bot command.
/// # Documentation
/// <https://core.telegram.org/bots/api#botcommand>
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct BotCommand {
    /// Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
    pub command: Box<str>,
    /// Description of the command; 1-256 characters.
    pub description: Box<str>,
}
impl BotCommand {
    /// Creates a new `BotCommand`.
    ///
    /// # Arguments
    /// * `command` - Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
    /// * `description` - Description of the command; 1-256 characters.
    #[must_use]
    pub fn new<T0: Into<Box<str>>, T1: Into<Box<str>>>(command: T0, description: T1) -> Self {
        Self {
            command: command.into(),
            description: description.into(),
        }
    }

    /// Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
    #[must_use]
    pub fn command<T: Into<Box<str>>>(self, val: T) -> Self {
        let mut this = self;
        this.command = val.into();
        this
    }

    /// Description of the command; 1-256 characters.
    #[must_use]
    pub fn description<T: Into<Box<str>>>(self, val: T) -> Self {
        let mut this = self;
        this.description = val.into();
        this
    }
}