This commit is contained in:
2023-05-06 23:14:19 +02:00
parent 3802ac0c1f
commit 08d55be68f
7 changed files with 31 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
use futures::TryStreamExt;
use regex::Regex;
use teloxide::{dispatching::UpdateFilterExt, dptree, prelude::*, types::*};
use teloxide::{dispatching::UpdateFilterExt, dptree, prelude::*, types::*, adaptors::Throttle};
use tokio_util::compat::FuturesAsyncReadCompatExt;
use crate::{
@@ -47,7 +47,7 @@ impl CommandParse<Self> for DownloadData {
async fn _send_cached(
message: &Message,
bot: &Bot,
bot: &Throttle<Bot>,
cached_message: CachedMessage,
) -> BotHandlerInternal {
match bot
@@ -66,7 +66,7 @@ async fn _send_cached(
async fn send_cached_message(
message: Message,
bot: Bot,
bot: Throttle<Bot>,
download_data: DownloadData,
) -> BotHandlerInternal {
if let Ok(v) = get_cached_message(&download_data).await {
@@ -83,7 +83,7 @@ async fn send_cached_message(
async fn _send_downloaded_file(
message: &Message,
bot: Bot,
bot: Throttle<Bot>,
downloaded_data: DownloadFile,
) -> BotHandlerInternal {
let DownloadFile {
@@ -113,7 +113,7 @@ async fn _send_downloaded_file(
async fn send_with_download_from_channel(
message: Message,
bot: Bot,
bot: Throttle<Bot>,
download_data: DownloadData,
) -> BotHandlerInternal {
match download_file(&download_data).await {
@@ -127,7 +127,7 @@ async fn send_with_download_from_channel(
async fn download_handler(
message: Message,
bot: Bot,
bot: Throttle<Bot>,
cache: BotCache,
download_data: DownloadData,
) -> BotHandlerInternal {
@@ -143,7 +143,7 @@ pub fn get_download_hander() -> crate::bots::BotHandler {
.chain(filter_command::<DownloadData>())
.endpoint(
|message: Message,
bot: Bot,
bot: Throttle<Bot>,
cache: BotCache,
download_data: DownloadData| async move {
download_handler(message, bot, cache, download_data).await