We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9afd244 + 1609efb commit ec15534Copy full SHA for ec15534
1 file changed
pyrogram/client/types/object.py
@@ -32,8 +32,15 @@ class Object(metaclass=Meta):
32
def __init__(self, client: "pyrogram.BaseClient" = None):
33
self._client = client
34
35
- if self._client is None:
36
- del self._client
+ def bind(self, client: "pyrogram.BaseClient"):
+ """Bind a Client instance to this Pyrogram Object
37
+
38
+ Parameters:
39
+ client (:obj:`Client`):
40
+ The Client instance to bind this object with. Useful to re-enable bound methods after serializing and
41
+ deserializing Pyrogram objects with ``repr`` and ``eval``.
42
+ """
43
+ self._client = client
44
45
@staticmethod
46
def default(obj: "Object"):
0 commit comments