diff --git a/pyrogram/api/core/primitives/vector.py b/pyrogram/api/core/primitives/vector.py index 60890ae6..49db28ec 100644 --- a/pyrogram/api/core/primitives/vector.py +++ b/pyrogram/api/core/primitives/vector.py @@ -25,11 +25,21 @@ from ..object import Object class Vector(Object): ID = 0x1cb5c415 + # Method added to handle the special case when a query returns a bare Vector (of Ints); + # i.e., RpcResult body starts with 0x1cb5c415 (Vector Id) - e.g., messages.GetMessagesViews. + @staticmethod + def _read(b: BytesIO) -> Object or int: + try: + return Object.read(b) + except KeyError: + b.seek(-4, 1) + return Int.read(b) + @staticmethod def read(b: BytesIO, t: Object = None) -> list: return [ t.read(b) if t - else Object.read(b) + else Vector._read(b) for _ in range(Int.read(b)) ]