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, ), )