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 {
    /// Puts the folders in the order of `folder_ids`.
    ///
    /// An empty slice fails with `Error::InvalidArgument`.
    pub async fn reorder_folders(&self, folder_ids: &[i32]) -> Result<()> {
        if folder_ids.is_empty() {
            return Err(Error::InvalidArgument("reorder_folders needs at least one folder id"));
        }
        self.invoke(&functions::messages::UpdateDialogFiltersOrder { order: folder_ids.to_vec() }).await?;
        Ok(())
    }
}