Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch PeerIdInvalid in get_dialogs
Browse files Browse the repository at this point in the history
msx98 authored and wulan17 committed Jan 26, 2025
1 parent 0108128 commit b93e43e
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
@@ -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:
@@ -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 = []

0 comments on commit b93e43e

Please sign in to comment.