We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c0806a commit 6eadb75Copy full SHA for 6eadb75
1 file changed
pyrogram/types/object.py
@@ -29,7 +29,7 @@ def __init__(self, client: "pyrogram.Client" = None):
29
self._client = client
30
31
def bind(self, client: "pyrogram.Client"):
32
- """Bind a Client instance to this Pyrogram Object
+ """Recursively bind a Client instance to this and to all nested Pyrogram objects.
33
34
Parameters:
35
client (:obj:`~pyrogram.types.Client`):
@@ -38,6 +38,12 @@ def bind(self, client: "pyrogram.Client"):
38
"""
39
40
41
+ for i in self.__dict__:
42
+ o = getattr(self, i)
43
+
44
+ if isinstance(o, Object):
45
+ o.bind(client)
46
47
@staticmethod
48
def default(obj: "Object"):
49
if isinstance(obj, bytes):
0 commit comments