This commit is contained in:
2024-01-07 21:44:22 +01:00
parent c0b348e6dc
commit fc8a7d4d89
3 changed files with 7 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ use self::{
use super::{
bots_manager::get_manager_handler, ignore_channel_messages, ignore_chat_member_update,
BotCommands, BotHandler,
ignore_user_edited_message, BotCommands, BotHandler,
};
async fn _update_activity(me: teloxide::types::Me, user: teloxide::types::User) -> Option<()> {
@@ -86,6 +86,7 @@ pub fn get_approved_handler() -> (BotHandler, BotCommands) {
dptree::entry()
.branch(ignore_channel_messages())
.branch(ignore_chat_member_update())
.branch(ignore_user_edited_message())
.branch(update_user_activity_handler())
.branch(get_help_handler())
.branch(get_settings_handler())

View File

@@ -95,7 +95,7 @@ where
let annotation_text = annotation.get_text();
let chunked_text = split_text_to_chunks(annotation_text, 512);
let current_text = chunked_text.get(0).unwrap();
let current_text = chunked_text.first().unwrap();
let callback_data = match command {
AnnotationCommand::Book { id } => AnnotationCallbackData::Book { id, page: 1 },

View File

@@ -28,6 +28,10 @@ fn ignore_chat_member_update() -> crate::bots::BotHandler {
.branch(Update::filter_my_chat_member().endpoint(|| async { Ok(()) }))
}
fn ignore_user_edited_message() -> crate::bots::BotHandler {
dptree::entry().branch(Update::filter_edited_message().endpoint(|| async { Ok(()) }))
}
pub fn get_bot_handler() -> (BotHandler, BotCommands) {
approved_bot::get_approved_handler()
}