mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix
This commit is contained in:
@@ -2,7 +2,7 @@ use std::{convert::TryInto, str::FromStr};
|
|||||||
|
|
||||||
use futures::TryStreamExt;
|
use futures::TryStreamExt;
|
||||||
use regex::Regex;
|
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 tokio_util::compat::FuturesAsyncReadCompatExt;
|
||||||
|
|
||||||
use crate::bots::{
|
use crate::bots::{
|
||||||
@@ -162,7 +162,7 @@ async fn download_image(
|
|||||||
|
|
||||||
pub async fn send_annotation_handler<T, Fut>(
|
pub async fn send_annotation_handler<T, Fut>(
|
||||||
message: Message,
|
message: Message,
|
||||||
bot: Bot,
|
bot: Throttle<Bot>,
|
||||||
command: AnnotationCommand,
|
command: AnnotationCommand,
|
||||||
annotation_getter: fn(id: u32) -> Fut,
|
annotation_getter: fn(id: u32) -> Fut,
|
||||||
) -> BotHandlerInternal
|
) -> BotHandlerInternal
|
||||||
@@ -248,7 +248,7 @@ where
|
|||||||
|
|
||||||
pub async fn annotation_pagination_handler<T, Fut>(
|
pub async fn annotation_pagination_handler<T, Fut>(
|
||||||
cq: CallbackQuery,
|
cq: CallbackQuery,
|
||||||
bot: Bot,
|
bot: Throttle<Bot>,
|
||||||
callback_data: AnnotationCallbackData,
|
callback_data: AnnotationCallbackData,
|
||||||
annotation_getter: fn(id: u32) -> Fut,
|
annotation_getter: fn(id: u32) -> Fut,
|
||||||
) -> BotHandlerInternal
|
) -> BotHandlerInternal
|
||||||
@@ -308,7 +308,7 @@ pub fn get_annotations_handler() -> crate::bots::BotHandler {
|
|||||||
Update::filter_message()
|
Update::filter_message()
|
||||||
.chain(filter_command::<AnnotationCommand>())
|
.chain(filter_command::<AnnotationCommand>())
|
||||||
.endpoint(
|
.endpoint(
|
||||||
|message: Message, bot: Bot, command: AnnotationCommand| async move {
|
|message: Message, bot: Throttle<Bot>, command: AnnotationCommand| async move {
|
||||||
match command {
|
match command {
|
||||||
AnnotationCommand::Book { .. } => {
|
AnnotationCommand::Book { .. } => {
|
||||||
send_annotation_handler(message, bot, command, get_book_annotation)
|
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::<AnnotationCallbackData>())
|
.chain(filter_callback_query::<AnnotationCallbackData>())
|
||||||
.endpoint(
|
.endpoint(
|
||||||
|cq: CallbackQuery,
|
|cq: CallbackQuery,
|
||||||
bot: Bot,
|
bot: Throttle<Bot>,
|
||||||
callback_data: AnnotationCallbackData| async move {
|
callback_data: AnnotationCallbackData| async move {
|
||||||
match callback_data {
|
match callback_data {
|
||||||
AnnotationCallbackData::Book { .. } => {
|
AnnotationCallbackData::Book { .. } => {
|
||||||
|
|||||||
Reference in New Issue
Block a user