Telethon - Many messages have views=None

Viewed 163

I'm trying to get the messages's views count through Telethon.

async def get_messages(entity=None, post_id=None, limit=1):
    await app.tl_client.get_dialogs()

    input_entity = await app.tl_client.get_input_entity(entity)
    print('input_entity->', input_entity)
    message = await app.tl_client.get_messages(entity, ids=post_id, limit=limit)
print('message ->', message)

The output is a Message object having views=None.

This happens for some messages, not all. How can a message have None views ? Is it a setting for chat administrators ?

1 Answers

Only messages in broadcast channels, or messages forwarded from them, have views. Notably, this means messages from private conversations, small group chats, and megagroup channels ("supergroups") will have views = None unless it is forwarded from a broadcast channel.

Related