From c604d8e728b273fc1365d672002e5612f8dadcd8 Mon Sep 17 00:00:00 2001 From: Manuel1510 <46545785+Manuel1510@users.noreply.github.com> Date: Sun, 27 Oct 2019 18:17:39 +0100 Subject: [PATCH] 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. --- telethon/client/updates.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/telethon/client/updates.py b/telethon/client/updates.py index 2a9dee95..0f1a1cc3 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -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(