vaegram 0.3.0

Telegram MTProto client library for users and bots
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::Client;
use crate::errors::{Error, Result};
use crate::raw::functions;

impl Client {
    /// Returns whether a name is usable for a new quick reply shortcut.
    ///
    /// Fails with `Error::InvalidArgument` if `shortcut` is empty.
    pub async fn check_quick_reply_shortcut(&self, shortcut: impl Into<String>) -> Result<bool> {
        let shortcut = shortcut.into();
        if shortcut.is_empty() {
            return Err(Error::InvalidArgument("a quick reply shortcut needs a name"));
        }
        self.invoke(&functions::messages::CheckQuickReplyShortcut { shortcut }).await
    }
}