diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 9c19e49a..c660ef21 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1108,7 +1108,7 @@ class Client(Methods, BaseClient): for name in vars(module).keys(): # noinspection PyBroadException try: - handler, group = getattr(module, name).pyrogram_plugin + handler, group = getattr(module, name).handler if isinstance(handler, Handler) and isinstance(group, int): self.add_handler(handler, group) @@ -1143,7 +1143,7 @@ class Client(Methods, BaseClient): for name in handlers: # noinspection PyBroadException try: - handler, group = getattr(module, name).pyrogram_plugin + handler, group = getattr(module, name).handler if isinstance(handler, Handler) and isinstance(group, int): self.add_handler(handler, group) @@ -1181,7 +1181,7 @@ class Client(Methods, BaseClient): for name in handlers: # noinspection PyBroadException try: - handler, group = getattr(module, name).pyrogram_plugin + handler, group = getattr(module, name).handler if isinstance(handler, Handler) and isinstance(group, int): self.remove_handler(handler, group) diff --git a/pyrogram/client/methods/decorators/on_callback_query.py b/pyrogram/client/methods/decorators/on_callback_query.py index 1706d71a..1b7e2bcb 100644 --- a/pyrogram/client/methods/decorators/on_callback_query.py +++ b/pyrogram/client/methods/decorators/on_callback_query.py @@ -47,7 +47,7 @@ class OnCallbackQuery(BaseClient): if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.CallbackQueryHandler(func, filters), group) elif isinstance(self, Filter) or self is None: - func.pyrogram_plugin = ( + func.handler = ( pyrogram.CallbackQueryHandler(func, self), group if filters is None else filters ) diff --git a/pyrogram/client/methods/decorators/on_deleted_messages.py b/pyrogram/client/methods/decorators/on_deleted_messages.py index 86dda587..cf31ac87 100644 --- a/pyrogram/client/methods/decorators/on_deleted_messages.py +++ b/pyrogram/client/methods/decorators/on_deleted_messages.py @@ -47,7 +47,7 @@ class OnDeletedMessages(BaseClient): if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.DeletedMessagesHandler(func, filters), group) elif isinstance(self, Filter) or self is None: - func.pyrogram_plugin = ( + func.handler = ( pyrogram.DeletedMessagesHandler(func, self), group if filters is None else filters ) diff --git a/pyrogram/client/methods/decorators/on_inline_query.py b/pyrogram/client/methods/decorators/on_inline_query.py index d0f2925b..a84b7ca9 100644 --- a/pyrogram/client/methods/decorators/on_inline_query.py +++ b/pyrogram/client/methods/decorators/on_inline_query.py @@ -46,7 +46,7 @@ class OnInlineQuery(BaseClient): if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.InlineQueryHandler(func, filters), group) elif isinstance(self, Filter) or self is None: - func.pyrogram_plugin = ( + func.handler = ( pyrogram.InlineQueryHandler(func, self), group if filters is None else filters ) diff --git a/pyrogram/client/methods/decorators/on_message.py b/pyrogram/client/methods/decorators/on_message.py index 5640f22c..0166541c 100644 --- a/pyrogram/client/methods/decorators/on_message.py +++ b/pyrogram/client/methods/decorators/on_message.py @@ -46,7 +46,7 @@ class OnMessage(BaseClient): if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.MessageHandler(func, filters), group) elif isinstance(self, Filter) or self is None: - func.pyrogram_plugin = ( + func.handler = ( pyrogram.MessageHandler(func, self), group if filters is None else filters ) diff --git a/pyrogram/client/methods/decorators/on_poll.py b/pyrogram/client/methods/decorators/on_poll.py index 24282f28..c797c8c6 100644 --- a/pyrogram/client/methods/decorators/on_poll.py +++ b/pyrogram/client/methods/decorators/on_poll.py @@ -46,7 +46,7 @@ class OnPoll(BaseClient): if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.PollHandler(func, filters), group) elif isinstance(self, Filter) or self is None: - func.pyrogram_plugin = ( + func.handler = ( pyrogram.PollHandler(func, self), group if filters is None else filters ) diff --git a/pyrogram/client/methods/decorators/on_raw_update.py b/pyrogram/client/methods/decorators/on_raw_update.py index bbf40c8b..f56de6f9 100644 --- a/pyrogram/client/methods/decorators/on_raw_update.py +++ b/pyrogram/client/methods/decorators/on_raw_update.py @@ -40,7 +40,7 @@ class OnRawUpdate(BaseClient): if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.RawUpdateHandler(func), group) else: - func.pyrogram_plugin = ( + func.handler = ( pyrogram.RawUpdateHandler(func), group if self is None else group ) diff --git a/pyrogram/client/methods/decorators/on_user_status.py b/pyrogram/client/methods/decorators/on_user_status.py index 81a83d02..02ed9e7b 100644 --- a/pyrogram/client/methods/decorators/on_user_status.py +++ b/pyrogram/client/methods/decorators/on_user_status.py @@ -44,7 +44,7 @@ class OnUserStatus(BaseClient): if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.UserStatusHandler(func, filters), group) elif isinstance(self, Filter) or self is None: - func.pyrogram_plugin = ( + func.handler = ( pyrogram.UserStatusHandler(func, self), group if filters is None else filters )