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
use crate::Client;
use crate::errors::Result;
use crate::methods::accepted;
use crate::raw::{base, functions, types};

impl Client {
    /// Accepts the terms of service with the given id.
    ///
    /// Take the id from [`TermsOfService`](crate::types::TermsOfService) as returned by
    /// [`get_terms_of_service_update`](Client::get_terms_of_service_update).
    pub async fn accept_terms_of_service(&self, terms_of_service_id: impl Into<String>) -> Result<()> {
        let id = base::DataJSON::DataJSON(Box::new(types::DataJSON { data: terms_of_service_id.into() }));
        accepted(self.invoke(&functions::help::AcceptTermsOfService { id }).await?)
    }
}