mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Reorder use
s in requests
This commit is contained in:
parent
94c5320ca8
commit
c3052ed036
7 changed files with 65 additions and 27 deletions
|
@ -1,10 +1,13 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use crate::core::{
|
||||
types::{ParseMode, InputMedia},
|
||||
requests::{ChatId, utils},
|
||||
};
|
||||
|
||||
use reqwest::r#async::multipart::Form;
|
||||
use serde::Serialize;
|
||||
use crate::core::types::ParseMode;
|
||||
use crate::core::requests::ChatId;
|
||||
use crate::core::requests::utils;
|
||||
use crate::core::types::InputMedia;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
||||
/// This is a convenient struct that builds `reqwest::r#async::multipart::Form`
|
||||
/// from scratch.
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
use crate::core::requests::form_builder::FormBuilder;
|
||||
use crate::core::requests::{ChatId, RequestContext, Request, RequestFuture, ResponseResult};
|
||||
use crate::core::types::Message;
|
||||
use crate::core::network;
|
||||
use crate::core::{
|
||||
network,
|
||||
types::Message,
|
||||
requests::{
|
||||
ChatId,
|
||||
Request,
|
||||
RequestFuture,
|
||||
RequestContext,
|
||||
ResponseResult,
|
||||
form_builder::FormBuilder,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
/// Use this method to forward messages of any kind. On success, the sent
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
use crate::core::network;
|
||||
use crate::core::requests::{
|
||||
Request, RequestFuture, RequestContext, ResponseResult,
|
||||
use crate::core::{
|
||||
network,
|
||||
types::User,
|
||||
requests::{
|
||||
Request,
|
||||
RequestFuture,
|
||||
RequestContext,
|
||||
ResponseResult
|
||||
},
|
||||
};
|
||||
use crate::core::types::User;
|
||||
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
/// A simple method for testing your bot's auth token. Requires no parameters.
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::future::Future;
|
||||
|
||||
use reqwest::r#async::Client;
|
||||
use reqwest::StatusCode;
|
||||
use reqwest::{
|
||||
r#async::Client, StatusCode
|
||||
};
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
|
||||
mod form_builder;
|
||||
mod utils;
|
||||
|
||||
#[derive(Debug, Display)]
|
||||
pub enum RequestError {
|
||||
|
@ -90,4 +93,3 @@ pub mod send_message;
|
|||
pub mod forward_message;
|
||||
pub mod send_photo;
|
||||
pub mod send_media_group;
|
||||
mod utils;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use crate::core::{
|
||||
types::{Message, InputMedia, InputFile},
|
||||
network::request_multipart,
|
||||
types::{Message, InputMedia, InputFile},
|
||||
requests::{
|
||||
form_builder::FormBuilder,
|
||||
ChatId,
|
||||
Request,
|
||||
RequestContext,
|
||||
RequestFuture,
|
||||
RequestContext,
|
||||
ResponseResult,
|
||||
form_builder::FormBuilder,
|
||||
}
|
||||
};
|
||||
use apply::Apply;
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
use crate::core::requests::form_builder::FormBuilder;
|
||||
use crate::core::requests::{
|
||||
ChatId, Request, RequestFuture, RequestContext, ResponseResult,
|
||||
use crate::core::{
|
||||
network,
|
||||
types::Message,
|
||||
types::ParseMode,
|
||||
requests::{
|
||||
form_builder::FormBuilder,
|
||||
ChatId,
|
||||
Request,
|
||||
RequestFuture,
|
||||
RequestContext,
|
||||
ResponseResult,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
use std::path::Path;
|
||||
|
||||
use crate::core::requests::{RequestContext, ChatId, Request, RequestFuture, ResponseResult};
|
||||
use crate::core::types::{ParseMode, Message, InputFile};
|
||||
use crate::core::requests::form_builder::FormBuilder;
|
||||
use crate::core::network;
|
||||
use crate::core::{
|
||||
network,
|
||||
types::{ParseMode, Message, InputFile},
|
||||
requests::{
|
||||
ChatId,
|
||||
Request,
|
||||
RequestFuture,
|
||||
RequestContext,
|
||||
ResponseResult,
|
||||
form_builder::FormBuilder,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
/// Use this method to send photos. On success, the sent [`Message`] is returned.
|
||||
|
|
Loading…
Reference in a new issue