mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-10 11:15:27 +00:00
Make plugin callback functions return the function itself when decorated
This commit is contained in:
@@ -1106,7 +1106,7 @@ class Client(Methods, BaseClient):
|
||||
for name in vars(module).keys():
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
handler, group = getattr(module, name)
|
||||
handler, group = getattr(module, name).pyrogram_plugin
|
||||
|
||||
if isinstance(handler, Handler) and isinstance(group, int):
|
||||
self.add_handler(handler, group)
|
||||
@@ -1141,7 +1141,7 @@ class Client(Methods, BaseClient):
|
||||
for name in handlers:
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
handler, group = getattr(module, name)
|
||||
handler, group = getattr(module, name).pyrogram_plugin
|
||||
|
||||
if isinstance(handler, Handler) and isinstance(group, int):
|
||||
self.add_handler(handler, group)
|
||||
@@ -1179,7 +1179,7 @@ class Client(Methods, BaseClient):
|
||||
for name in handlers:
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
handler, group = getattr(module, name)
|
||||
handler, group = getattr(module, name).pyrogram_plugin
|
||||
|
||||
if isinstance(handler, Handler) and isinstance(group, int):
|
||||
self.remove_handler(handler, group)
|
||||
|
Reference in New Issue
Block a user