From 997bc4df220c084f6ae5b356a7ea791103edd3e1 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Sat, 6 May 2023 23:16:21 +0200 Subject: [PATCH] Fix --- src/bots/approved_bot/modules/annotations.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bots/approved_bot/modules/annotations.rs b/src/bots/approved_bot/modules/annotations.rs index 57976a4..1fccfe4 100644 --- a/src/bots/approved_bot/modules/annotations.rs +++ b/src/bots/approved_bot/modules/annotations.rs @@ -2,7 +2,7 @@ use std::{convert::TryInto, str::FromStr}; 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::bots::{ @@ -162,7 +162,7 @@ async fn download_image( pub async fn send_annotation_handler( message: Message, - bot: Bot, + bot: Throttle, command: AnnotationCommand, annotation_getter: fn(id: u32) -> Fut, ) -> BotHandlerInternal @@ -248,7 +248,7 @@ where pub async fn annotation_pagination_handler( cq: CallbackQuery, - bot: Bot, + bot: Throttle, callback_data: AnnotationCallbackData, annotation_getter: fn(id: u32) -> Fut, ) -> BotHandlerInternal @@ -308,7 +308,7 @@ pub fn get_annotations_handler() -> crate::bots::BotHandler { Update::filter_message() .chain(filter_command::()) .endpoint( - |message: Message, bot: Bot, command: AnnotationCommand| async move { + |message: Message, bot: Throttle, command: AnnotationCommand| async move { match command { AnnotationCommand::Book { .. } => { send_annotation_handler(message, bot, command, get_book_annotation) @@ -332,7 +332,7 @@ pub fn get_annotations_handler() -> crate::bots::BotHandler { .chain(filter_callback_query::()) .endpoint( |cq: CallbackQuery, - bot: Bot, + bot: Throttle, callback_data: AnnotationCallbackData| async move { match callback_data { AnnotationCallbackData::Book { .. } => {