0

I try get and increase view a post channel but get this error:

File ~/.../venv/lib/python3.10/site-packages/pyrogram/raw/core/primitives/vector.py:57, in Vector.__new__(cls, value, t)
     55 def __new__(cls, value: list, t: Any = None) -> bytes:  # type: ignore
     56     return b"".join(
---> 57         [Int(cls.ID, False), Int(len(value))]
     58         + [cast(bytes, t(i)) if t else i.write() for i in value]
     59     )

TypeError: object of type 'int' has no len()`

I am using this code:

from pyrogram.raw.functions.messages import GetMessagesViews
from pyrogram import Client

app = Client('account',1234,'XXXXXXXX')
app.start()

await app.invoke(GetMessagesViews(peer=await app.resolve_peer('CHANNLE_ID'), id=7, increment=True))`
user16217248
  • 3,119
  • 19
  • 19
  • 37
Pooya
  • 1
  • You're making us guess where the source of the error is. Please update the question and include the **whole** error traceback message. – John Gordon May 03 '23 at 19:40
  • 1
    The `id` argument is supposed to be a list of integers, not a single integer. See https://docs.pyrogram.org/telegram/functions/messages/get-messages-views#messages-getmessagesviews – Barmar May 03 '23 at 19:42
  • So change to `id=[7]` – Barmar May 03 '23 at 19:43
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 03 '23 at 22:00

0 Answers0