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