diff --git a/src/bot/mod.rs b/src/bot/mod.rs index 4f370663..34020623 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -1,3 +1,5 @@ +//! A Telegram bot. + use reqwest::Client; use crate::requests::RequestContext; diff --git a/src/dispatcher/mod.rs b/src/dispatcher/mod.rs index a4d5c310..b957411a 100644 --- a/src/dispatcher/mod.rs +++ b/src/dispatcher/mod.rs @@ -1,4 +1,4 @@ -//! POC implementation of update dispatching +//! Update dispatching. pub mod filter; pub mod handler; diff --git a/src/requests/mod.rs b/src/requests/mod.rs index 2a4d922c..50f7ffaa 100644 --- a/src/requests/mod.rs +++ b/src/requests/mod.rs @@ -1,3 +1,5 @@ +//! Raw API functions. + use reqwest::Client; use serde::de::DeserializeOwned; @@ -59,6 +61,7 @@ mod stop_message_live_location; mod unban_chat_member; mod unpin_chat_message; +/// A type that is returned from `Request::send_boxed`. pub type ResponseResult = Result; /// A request that can be sent to Telegram. @@ -71,8 +74,11 @@ pub trait Request { async fn send_boxed(self) -> ResponseResult; } +/// A context used to send all the requests. #[derive(Debug, Clone)] pub struct RequestContext<'a> { + /// An HTTPS client. pub client: &'a Client, + /// A token of your bot. pub token: &'a str, } diff --git a/src/types/mod.rs b/src/types/mod.rs index 4aafcb55..b3268627 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1,3 +1,5 @@ +//! Raw API structures. + pub use self::{ animation::Animation, audio::Audio,