-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Increasing View Count
Aahnik Daw edited this page May 16, 2021
·
3 revisions
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
))