mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-28 04:13:45 +03:00
Create page
parent
1dd214ffde
commit
2b0caae2dd
12
Increasing-View-Count.md
Normal file
12
Increasing-View-Count.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
It has been asked [quite](https://github.com/LonamiWebs/Telethon/issues/233) [a few](https://github.com/LonamiWebs/Telethon/issues/305) [times](https://github.com/LonamiWebs/Telethon/issues/409), and while I don't understand why so many people ask this, the solution is to use [`GetMessagesViewsRequest`](https://lonamiwebs.github.io/Telethon/methods/messages/get_messages_views.html), setting `increment=True`:
|
||||||
|
```python
|
||||||
|
|
||||||
|
# Obtain `channel' through dialogs or through client.get_entity() or anyhow.
|
||||||
|
# Obtain `msg_ids' through `.get_message_history()` or anyhow. Must be a list.
|
||||||
|
|
||||||
|
client(GetMessagesViewsRequest(
|
||||||
|
peer=channel,
|
||||||
|
id=msg_ids,
|
||||||
|
increment=True
|
||||||
|
))
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user