1 parent 035bbbb commit b423730Copy full SHA for b423730
2 files changed
pyrogram/methods/decorators/on_disconnect.py
@@ -32,6 +32,11 @@ def on_disconnect(self=None) -> Callable:
32
def decorator(func: Callable) -> Callable:
33
if isinstance(self, pyrogram.Client):
34
self.add_handler(pyrogram.handlers.DisconnectHandler(func))
35
+ else:
36
+ if not hasattr(func, "handlers"):
37
+ func.handlers = []
38
+
39
+ func.handlers.append((pyrogram.handlers.DisconnectHandler(func), 0))
40
41
return func
42
pyrogram/methods/decorators/on_raw_update.py
@@ -46,7 +46,7 @@ def decorator(func: Callable) -> Callable:
46
func.handlers.append(
47
(
48
pyrogram.handlers.RawUpdateHandler(func),
49
- group if self is None else group
+ group
50
)
51
52
0 commit comments