Skip to content

Commit

Permalink
Merge pull request #102 from msx98/getdialogs-catch-peeridinvalid
Browse files Browse the repository at this point in the history
Catch `PeerIdInvalid` in `get_dialogs`
  • Loading branch information
wulan17 authored Jan 26, 2025
2 parents 5676006 + dd9ae86 commit a653065
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyrogram/methods/chats/get_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import pyrogram
from pyrogram import types, raw, utils
from pyrogram.errors import ChannelPrivate
from pyrogram.errors import ChannelPrivate, PeerIdInvalid


class GetDialogs:
Expand Down Expand Up @@ -80,7 +80,7 @@ async def get_dialogs(
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 = []
Expand Down

0 comments on commit a653065

Please sign in to comment.