2024-10-08 22:37:22 +03:00
|
|
|
use std::ops::Deref;
|
|
|
|
|
2025-04-09 23:46:50 +03:00
|
|
|
use telers::{
|
|
|
|
event::{telegram::HandlerResult, EventReturn},
|
|
|
|
filters::CommandObject,
|
|
|
|
types::Message,
|
|
|
|
Bot,
|
|
|
|
};
|
2024-10-08 22:37:22 +03:00
|
|
|
|
|
|
|
use crate::{
|
|
|
|
assets::files::{HELP_COMMAND_TEXT, PRIVACY_COMMAND_TEXT},
|
|
|
|
utils::telegram::senders::send_html,
|
|
|
|
};
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
pub async fn info_commands_endpoint(
|
|
|
|
bot: Bot,
|
2025-04-09 23:46:50 +03:00
|
|
|
message: Message,
|
|
|
|
command_object: CommandObject,
|
2024-10-08 22:37:22 +03:00
|
|
|
) -> HandlerResult {
|
2025-04-09 23:46:50 +03:00
|
|
|
match command_object.command.deref() {
|
2025-04-11 11:10:52 +03:00
|
|
|
"help" => send_html(&bot, &message, HELP_COMMAND_TEXT).await,
|
|
|
|
"privacy" => send_html(&bot, &message, PRIVACY_COMMAND_TEXT).await,
|
2025-04-09 23:46:50 +03:00
|
|
|
_ => Ok(EventReturn::Cancel),
|
2024-10-08 22:37:22 +03:00
|
|
|
}
|
|
|
|
}
|