Skip to content

Commit a653065

Browse files
authored
Merge pull request #102 from msx98/getdialogs-catch-peeridinvalid
Catch `PeerIdInvalid` in `get_dialogs`
2 parents 5676006 + dd9ae86 commit a653065

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyrogram/methods/chats/get_dialogs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import pyrogram
2323
from pyrogram import types, raw, utils
24-
from pyrogram.errors import ChannelPrivate
24+
from pyrogram.errors import ChannelPrivate, PeerIdInvalid
2525

2626

2727
class GetDialogs:
@@ -80,7 +80,7 @@ async def get_dialogs(
8080
chat_id = utils.get_peer_id(message.peer_id)
8181
try:
8282
messages[chat_id] = await types.Message._parse(self, message, users, chats)
83-
except ChannelPrivate:
83+
except (ChannelPrivate, PeerIdInvalid):
8484
continue
8585

8686
dialogs = []

0 commit comments

Comments
 (0)