mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
Fixes
This commit is contained in:
parent
f95ea5ee31
commit
ec4d23626a
6 changed files with 10 additions and 22 deletions
|
@ -1,8 +1,10 @@
|
|||
use futures::StreamExt;
|
||||
use reqwest::r#async::{Chunk, Client};
|
||||
use tokio::{
|
||||
io::{AsyncWrite, AsyncWriteExt},
|
||||
stream::Stream,
|
||||
};
|
||||
use bytes::Buf;
|
||||
|
||||
use crate::{
|
||||
network::{file_url, TELEGRAM_API_URL},
|
||||
|
@ -27,7 +29,7 @@ where
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn download_file_stream(
|
||||
pub async fn download_file_stream(
|
||||
client: &Client,
|
||||
token: &str,
|
||||
path: &str,
|
||||
|
|
|
@ -2,23 +2,9 @@ mod download;
|
|||
mod request;
|
||||
mod telegram_response;
|
||||
|
||||
use apply::Apply;
|
||||
use bytes::Buf;
|
||||
use futures::StreamExt;
|
||||
use reqwest::{
|
||||
r#async::{multipart::Form, Chunk, Client, Response},
|
||||
StatusCode,
|
||||
};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use tokio::{
|
||||
io::{AsyncWrite, AsyncWriteExt},
|
||||
stream::Stream,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
requests::ResponseResult, types::ResponseParameters, DownloadError,
|
||||
RequestError,
|
||||
};
|
||||
pub use download::{download_file, download_file_stream};
|
||||
pub use request::{request_json, request_multipart};
|
||||
pub use telegram_response::TelegramResponse;
|
||||
|
||||
pub const TELEGRAM_API_URL: &str = "https://api.telegram.org";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use reqwest::r#async::{multipart::Form, Client, Response};
|
|||
use serde::{de::DeserializeOwned, Serialize};
|
||||
|
||||
use crate::{
|
||||
network::{method_url, TELEGRAM_API_URL},
|
||||
network::{method_url, TELEGRAM_API_URL, TelegramResponse},
|
||||
requests::ResponseResult,
|
||||
RequestError,
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::{
|
|||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(untagged)]
|
||||
enum TelegramResponse<R> {
|
||||
pub enum TelegramResponse<R> {
|
||||
Ok {
|
||||
/// A dummy field. Used only for deserialization.
|
||||
#[allow(dead_code)]
|
||||
|
|
|
@ -14,7 +14,7 @@ pub use self::{
|
|||
file::File,
|
||||
force_reply::ForceReply,
|
||||
game::Game,
|
||||
game_high_score,
|
||||
game_high_score::GameHighScore,
|
||||
inline_keyboard_button::{InlineKeyboardButton, InlineKeyboardButtonKind},
|
||||
inline_keyboard_markup::InlineKeyboardMarkup,
|
||||
inline_query::InlineQuery,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::types::Sticker;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq, Clone)]
|
||||
#[derive(Debug, Deserialize, PartialEq, Clone)]
|
||||
pub struct StickerSet {
|
||||
pub name: String,
|
||||
pub title: String,
|
||||
|
|
Loading…
Reference in a new issue