mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::bots::BotHandlerInternal;
|
||||
|
||||
use teloxide::{
|
||||
adaptors::{CacheMe, Throttle}, prelude::*, types::MaybeInaccessibleMessage, utils::command::BotCommands
|
||||
adaptors::{CacheMe, Throttle}, prelude::*, utils::command::BotCommands
|
||||
};
|
||||
|
||||
#[derive(BotCommands, Clone)]
|
||||
@@ -12,14 +12,9 @@ enum SupportCommand {
|
||||
}
|
||||
|
||||
pub async fn support_command_handler(
|
||||
orgingal_message: MaybeInaccessibleMessage,
|
||||
message: Message,
|
||||
bot: CacheMe<Throttle<Bot>>,
|
||||
) -> BotHandlerInternal {
|
||||
let message = match orgingal_message {
|
||||
MaybeInaccessibleMessage::Regular(message) => message,
|
||||
MaybeInaccessibleMessage::Inaccessible(_) => return Ok(()),
|
||||
};
|
||||
|
||||
let username = match message.clone().from {
|
||||
Some(user) => {
|
||||
match user.is_bot {
|
||||
|
||||
@@ -31,7 +31,12 @@ pub async fn send_donation_notification(
|
||||
.await;
|
||||
mark_donate_notification_sent(message.chat().id).await?;
|
||||
|
||||
support_command_handler(message, bot).await?;
|
||||
match message {
|
||||
MaybeInaccessibleMessage::Regular(message) => {
|
||||
support_command_handler(message, bot).await?;
|
||||
}
|
||||
MaybeInaccessibleMessage::Inaccessible(_) => {}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user