Skip to content

Commit b8934ae

Browse files
authored
Don't process MessageEmpty in get_dialogs
Prevent ``` File "C:\Users\INT002327\AppData\Local\pypoetry\Cache\virtualenvs\josxabot-c3BmTbt9-py3.8\lib\site-packages\pyrogram\methods\chats\get_dialogs.py", line 92, in get_dialogs to_id = message.to_id └ pyrogram.raw.types.MessageEmpty(id=2767691) AttributeError: 'MessageEmpty' object has no attribute 'to_id' ```
1 parent 601483f commit b8934ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pyrogram/methods/chats/get_dialogs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ async def get_dialogs(
8989
messages = {}
9090

9191
for message in r.messages:
92+
if message.empty:
93+
continue
94+
9295
peer_id = message.peer_id
9396

9497
if isinstance(peer_id, raw.types.PeerUser):

0 commit comments

Comments
 (0)