Pyrofork: Add ChannelPrivate exception handler to get_dialogs method

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-01-07 18:19:44 +07:00
parent f2b6182584
commit a95c1b6ac1
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

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