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:
@@ -1,7 +1,7 @@
|
|||||||
use crate::bots::BotHandlerInternal;
|
use crate::bots::BotHandlerInternal;
|
||||||
|
|
||||||
use teloxide::{
|
use teloxide::{
|
||||||
adaptors::{CacheMe, Throttle}, prelude::*, types::MaybeInaccessibleMessage, utils::command::BotCommands
|
adaptors::{CacheMe, Throttle}, prelude::*, utils::command::BotCommands
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(BotCommands, Clone)]
|
#[derive(BotCommands, Clone)]
|
||||||
@@ -12,14 +12,9 @@ enum SupportCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn support_command_handler(
|
pub async fn support_command_handler(
|
||||||
orgingal_message: MaybeInaccessibleMessage,
|
message: Message,
|
||||||
bot: CacheMe<Throttle<Bot>>,
|
bot: CacheMe<Throttle<Bot>>,
|
||||||
) -> BotHandlerInternal {
|
) -> BotHandlerInternal {
|
||||||
let message = match orgingal_message {
|
|
||||||
MaybeInaccessibleMessage::Regular(message) => message,
|
|
||||||
MaybeInaccessibleMessage::Inaccessible(_) => return Ok(()),
|
|
||||||
};
|
|
||||||
|
|
||||||
let username = match message.clone().from {
|
let username = match message.clone().from {
|
||||||
Some(user) => {
|
Some(user) => {
|
||||||
match user.is_bot {
|
match user.is_bot {
|
||||||
|
|||||||
@@ -31,7 +31,12 @@ pub async fn send_donation_notification(
|
|||||||
.await;
|
.await;
|
||||||
mark_donate_notification_sent(message.chat().id).await?;
|
mark_donate_notification_sent(message.chat().id).await?;
|
||||||
|
|
||||||
|
match message {
|
||||||
|
MaybeInaccessibleMessage::Regular(message) => {
|
||||||
support_command_handler(message, bot).await?;
|
support_command_handler(message, bot).await?;
|
||||||
|
}
|
||||||
|
MaybeInaccessibleMessage::Inaccessible(_) => {}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user