Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadHistoryRequest does not increase views count on the channel #305

Closed
artem-gunkin opened this issue Oct 8, 2017 · 8 comments
Closed

Comments

@artem-gunkin
Copy link

artem-gunkin commented Oct 8, 2017

I try to sign in account and get histrory message:

client = TelegramClient(session, api_id, api_hash)
client.connect()
channel = client.get_entity('@some_channel')
count, messages, senders = client(ReadHistoryRequest(channel, 100))

Then check message views. But they do not change. Is there some other methods for mark channel messages as viewed?

@artem-gunkin artem-gunkin changed the title ReadHistoryRequest() does not increase post views count on the channel ReadHistoryRequest() does not increase views count on the channel Oct 8, 2017
@artem-gunkin artem-gunkin changed the title ReadHistoryRequest() does not increase views count on the channel ReadHistoryRequest does not increase views count on the channel Oct 8, 2017
@Lonami
Copy link
Member

Lonami commented Oct 8, 2017

You know GetHistoryRequest and ReadHistoryRequest are different things, don't you?

@Lonami Lonami closed this as completed Oct 8, 2017
@artem-gunkin
Copy link
Author

Sorry, I try both methods and create incorrect issue comment. ReadHistoryRequest doesn't work too.

@Lonami
Copy link
Member

Lonami commented Oct 8, 2017

That's because you want to .increment the GetMessagesViewsRequest

@ablkvo
Copy link

ablkvo commented Oct 21, 2017

I used this code to do above job to count up views. but it didn't work.

from telethon import TelegramClient
import telethon
api_id = xxx
api_hash = 'xxxx'
phone = '+1580823xxxx'
client = TelegramClient('session_name', api_id, api_hash)
client.connect()
entity = client.get_entity('testitby')
peer=telethon.tl.functions.get_input_peer(entity)
total, messages, senders = client.get_message_history('testitby')
telethon.tl.functions.messages.GetMessagesViewsRequest(peer=peer, id=[messages[0].id], increment=True)

It didn't come up with errors but didn't work as well and The post in the channel 'testitby' didn't count up in views.
any help would be appreciated.

@Lonami
Copy link
Member

Lonami commented Oct 21, 2017

Telegram likely has its own mechanism to allow you to increment the view count only once, so if you've seen the post on any other client, calling that likely won't increment the count. Possibly only working once. Send a message through another account, and then from the account you're using on Telethon, call the method. Compare the view count.

@ablkvo
Copy link

ablkvo commented Oct 21, 2017

Hi Dear Lonami,
I tried what you said but it didn't work.
have you ever tried to do something similar?

@Lonami
Copy link
Member

Lonami commented Oct 21, 2017

No I've never tried but that's the only request that has an increment-like action.

@NabiKAZ
Copy link

NabiKAZ commented Jul 6, 2018

Attention:

Seems that if the messages.getMessagesViews are used successive in a large number for a few hours, the viewer will not increase further for current client for any posts, and also don't return any error message, and just return current view of post.
A silent flood !!!
But, after a few hours, everything will return to its original state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants