From a6c728b93e482dcf212c96512feb14f4e15af94a Mon Sep 17 00:00:00 2001 From: Zaid _ Date: Wed, 26 Jun 2024 18:28:47 +0300 Subject: [PATCH] Add on_all decorator --- tgram/decorators.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tgram/decorators.py b/tgram/decorators.py index 928edb7..5a3c987 100644 --- a/tgram/decorators.py +++ b/tgram/decorators.py @@ -6,6 +6,13 @@ class Decorators: + def on_all(self: "tgram.TgBot"): + def decorator(func: Callable) -> Callable: + self.add_handler(Handler(callback=func)) + return func + + return decorator + def on_message(self: "tgram.TgBot", filters: Filter = None): def decorator(func: Callable) -> Callable: self.add_handler(