vaegram 0.2.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
17
use crate::Client;
use crate::errors::{Error, Result};
use crate::methods::accepted;
use crate::raw::functions;

impl Client {
    /// Sets the order of the quick reply shortcuts to `shortcut_ids`.
    ///
    /// Fails with `Error::InvalidArgument` if `shortcut_ids` is empty.
    pub async fn reorder_quick_replies(&self, shortcut_ids: impl IntoIterator<Item = i32>) -> Result<()> {
        let order: Vec<i32> = shortcut_ids.into_iter().collect();
        if order.is_empty() {
            return Err(Error::InvalidArgument("reorder_quick_replies needs at least one shortcut id"));
        }
        accepted(self.invoke(&functions::messages::ReorderQuickReplies { order }).await?)
    }
}