3 Increasing View Count
Aahnik Daw edited this page 2021-05-16 19:30:30 +05:30

It has been asked quite a few times (really, many), and while I don't understand why so many people ask this, the solution is to use GetMessagesViewsRequest, setting increment=True:

from telethon.sync import TelegramClient,functions

CHANNEL = "channel_username" # Obtain `channel' through dialogs or through client.get_entity() or anyhow.
MSG_IDS = [] # Obtain `msg_ids' through `.get_message_history()` or anyhow. Must be a list.

client = TelegramClient("telethon", API_ID, API_HASH).start(phone="xxx")

client(functions.messages.GetMessagesViewsRequest(
    peer=CHANNEL,
    id=MSG_IDS,
    increment=True
))