Skip to content

Commit

Permalink
update handlers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jan 5, 2025
1 parent b8cc938 commit a887689
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bot/core/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
)

Expand Down

0 comments on commit a887689

Please sign in to comment.