From a887689fe0d06d6b6d5bd9da77ada2e40480c8d4 Mon Sep 17 00:00:00 2001 From: 5hojib Date: Sun, 5 Jan 2025 20:21:26 +0600 Subject: [PATCH] update handlers.py --- bot/core/handlers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot/core/handlers.py b/bot/core/handlers.py index 60d188be5..d170e5ebb 100644 --- a/bot/core/handlers.py +++ b/bot/core/handlers.py @@ -193,10 +193,15 @@ def add_handlers(): } for handler_func, command_name, custom_filter in command_filters.values(): + if custom_filter: + filters_to_apply = command(command_name, case_sensitive=True) & custom_filter + else: + filters_to_apply = command(command_name, case_sensitive=True) + TgClient.bot.add_handler( MessageHandler( handler_func, - filters=command(command_name, case_sensitive=True) & (custom_filter if custom_filter), + filters=filters_to_apply, ), )