We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b6d717 commit 3eaba9dCopy full SHA for 3eaba9d
pyrogram/api/core/primitives/vector.py
@@ -25,11 +25,21 @@
25
class Vector(Object):
26
ID = 0x1cb5c415
27
28
+ # Method added to handle the special case when a query returns a bare Vector (of Ints);
29
+ # i.e., RpcResult body starts with 0x1cb5c415 (Vector Id) - e.g., messages.GetMessagesViews.
30
+ @staticmethod
31
+ def _read(b: BytesIO) -> Object or int:
32
+ try:
33
+ return Object.read(b)
34
+ except KeyError:
35
+ b.seek(-4, 1)
36
+ return Int.read(b)
37
+
38
@staticmethod
39
def read(b: BytesIO, t: Object = None) -> list:
40
return [
41
t.read(b) if t
- else Object.read(b)
42
+ else Vector._read(b)
43
for _ in range(Int.read(b))
44
]
45
0 commit comments