Use channels.GetFullChannel instead of messages.getPeerDialogs

Bots can't use messages.getPeerDialogs, so the only way to get the initial channel pts for them is to use getFullChannel.
This commit is contained in:
Manuel1510 2019-10-27 18:17:39 +01:00 committed by GitHub
parent 5dcc30dcc6
commit c604d8e728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -459,10 +459,10 @@ class UpdateMethods:
if not pts_date:
# First-time, can't get difference. Get pts instead.
result = await self(functions.messages.GetPeerDialogsRequest([
utils.get_input_dialog(where)
]))
self._state_cache[channel_id] = result.dialogs[0].pts
result = await self(functions.channels.getFullChannel(
channel=where
))
self._state_cache[channel_id] = result.full_chat.pts
return
result = await self(functions.updates.GetChannelDifferenceRequest(