This commit is contained in:
2025-01-04 15:48:53 +01:00
parent d25542a4bc
commit 1f12fc1873
2 changed files with 8 additions and 8 deletions

View File

@@ -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 {

View File

@@ -31,7 +31,12 @@ pub async fn send_donation_notification(
.await;
mark_donate_notification_sent(message.chat().id).await?;
match message {
MaybeInaccessibleMessage::Regular(message) => {
support_command_handler(message, bot).await?;
}
MaybeInaccessibleMessage::Inaccessible(_) => {}
}
Ok(())
}