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 reqwest::r#async::multipart::Form;
|
||||||
use serde::Serialize;
|
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`
|
/// This is a convenient struct that builds `reqwest::r#async::multipart::Form`
|
||||||
/// from scratch.
|
/// from scratch.
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
use crate::core::requests::form_builder::FormBuilder;
|
use crate::core::{
|
||||||
use crate::core::requests::{ChatId, RequestContext, Request, RequestFuture, ResponseResult};
|
network,
|
||||||
use crate::core::types::Message;
|
types::Message,
|
||||||
use crate::core::network;
|
requests::{
|
||||||
|
ChatId,
|
||||||
|
Request,
|
||||||
|
RequestFuture,
|
||||||
|
RequestContext,
|
||||||
|
ResponseResult,
|
||||||
|
form_builder::FormBuilder,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
/// Use this method to forward messages of any kind. On success, the sent
|
/// Use this method to forward messages of any kind. On success, the sent
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
use crate::core::network;
|
use crate::core::{
|
||||||
use crate::core::requests::{
|
network,
|
||||||
Request, RequestFuture, RequestContext, ResponseResult,
|
types::User,
|
||||||
|
requests::{
|
||||||
|
Request,
|
||||||
|
RequestFuture,
|
||||||
|
RequestContext,
|
||||||
|
ResponseResult
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use crate::core::types::User;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
/// A simple method for testing your bot's auth token. Requires no parameters.
|
/// 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::pin::Pin;
|
||||||
|
use std::future::Future;
|
||||||
|
|
||||||
use reqwest::r#async::Client;
|
use reqwest::{
|
||||||
use reqwest::StatusCode;
|
r#async::Client, StatusCode
|
||||||
|
};
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
|
|
||||||
|
|
||||||
mod form_builder;
|
mod form_builder;
|
||||||
|
mod utils;
|
||||||
|
|
||||||
#[derive(Debug, Display)]
|
#[derive(Debug, Display)]
|
||||||
pub enum RequestError {
|
pub enum RequestError {
|
||||||
|
@ -90,4 +93,3 @@ pub mod send_message;
|
||||||
pub mod forward_message;
|
pub mod forward_message;
|
||||||
pub mod send_photo;
|
pub mod send_photo;
|
||||||
pub mod send_media_group;
|
pub mod send_media_group;
|
||||||
mod utils;
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use crate::core::{
|
use crate::core::{
|
||||||
types::{Message, InputMedia, InputFile},
|
|
||||||
network::request_multipart,
|
network::request_multipart,
|
||||||
|
types::{Message, InputMedia, InputFile},
|
||||||
requests::{
|
requests::{
|
||||||
form_builder::FormBuilder,
|
|
||||||
ChatId,
|
ChatId,
|
||||||
Request,
|
Request,
|
||||||
RequestContext,
|
|
||||||
RequestFuture,
|
RequestFuture,
|
||||||
|
RequestContext,
|
||||||
ResponseResult,
|
ResponseResult,
|
||||||
|
form_builder::FormBuilder,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
use apply::Apply;
|
use apply::Apply;
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
use crate::core::requests::form_builder::FormBuilder;
|
use crate::core::{
|
||||||
use crate::core::requests::{
|
network,
|
||||||
ChatId, Request, RequestFuture, RequestContext, ResponseResult,
|
types::Message,
|
||||||
|
types::ParseMode,
|
||||||
|
requests::{
|
||||||
|
form_builder::FormBuilder,
|
||||||
|
ChatId,
|
||||||
|
Request,
|
||||||
|
RequestFuture,
|
||||||
|
RequestContext,
|
||||||
|
ResponseResult,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use crate::core::requests::{RequestContext, ChatId, Request, RequestFuture, ResponseResult};
|
use crate::core::{
|
||||||
use crate::core::types::{ParseMode, Message, InputFile};
|
network,
|
||||||
use crate::core::requests::form_builder::FormBuilder;
|
types::{ParseMode, Message, InputFile},
|
||||||
use crate::core::network;
|
requests::{
|
||||||
|
ChatId,
|
||||||
|
Request,
|
||||||
|
RequestFuture,
|
||||||
|
RequestContext,
|
||||||
|
ResponseResult,
|
||||||
|
form_builder::FormBuilder,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
/// Use this method to send photos. On success, the sent [`Message`] is returned.
|
/// Use this method to send photos. On success, the sent [`Message`] is returned.
|
||||||
|
|
Loading…
Reference in a new issue