From 5c5cee16d9e1811b5e8c9a11fb89257a0433db5d Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 1 Oct 2020 13:22:38 +0200 Subject: [PATCH] Lower log severity when receiving empty messages --- telethon/statecache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/statecache.py b/telethon/statecache.py index 268a2bca..0e02bbd4 100644 --- a/telethon/statecache.py +++ b/telethon/statecache.py @@ -135,7 +135,10 @@ class StateCache: return update.channel_id elif cid in has_message: if update.message.peer_id is None: - self._logger.info('Update has None peer_id %s', update) + # Telegram sometimes sends empty messages to give a newer pts: + # UpdateNewChannelMessage(message=MessageEmpty(id), pts=pts, pts_count=1) + # Not sure why, but it's safe to ignore them. + self._logger.debug('Update has None peer_id %s', update) else: return update.message.peer_id.channel_id