Merge pull request #102 from msx98/getdialogs-catch-peeridinvalid

Catch `PeerIdInvalid` in `get_dialogs`
This commit is contained in:
2025-01-26 20:40:41 +07:00 committed by GitHub
commit a653065774
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,7 +21,7 @@ from typing import AsyncGenerator, Optional
import pyrogram
from pyrogram import types, raw, utils
from pyrogram.errors import ChannelPrivate
from pyrogram.errors import ChannelPrivate, PeerIdInvalid
class GetDialogs:
@ -80,7 +80,7 @@ class GetDialogs:
chat_id = utils.get_peer_id(message.peer_id)
try:
messages[chat_id] = await types.Message._parse(self, message, users, chats)
except ChannelPrivate:
except (ChannelPrivate, PeerIdInvalid):
continue
dialogs = []