mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Add some documentation
This commit is contained in:
parent
76a10abc47
commit
7d2d8f706d
4 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
//! A Telegram bot.
|
||||
|
||||
use reqwest::Client;
|
||||
|
||||
use crate::requests::RequestContext;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! POC implementation of update dispatching
|
||||
//! Update dispatching.
|
||||
|
||||
pub mod filter;
|
||||
pub mod handler;
|
||||
|
|
|
@ -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<T> = Result<T, RequestError>;
|
||||
|
||||
/// A request that can be sent to Telegram.
|
||||
|
@ -71,8 +74,11 @@ pub trait Request {
|
|||
async fn send_boxed(self) -> ResponseResult<Self::Output>;
|
||||
}
|
||||
|
||||
/// 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,
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Raw API structures.
|
||||
|
||||
pub use self::{
|
||||
animation::Animation,
|
||||
audio::Audio,
|
||||
|
|
Loading…
Reference in a new issue