Catch PeerIdInvalid in get_dialogs

This commit is contained in:
msx98 2024-11-29 13:38:29 +02:00
parent d7018d8ed1
commit dd9ae86d8b

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 = []