mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Pyrofork: Add ChannelPrivate exception handler to get_dialogs method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
f2b6182584
commit
a95c1b6ac1
1 changed files with 5 additions and 1 deletions
|
|
@ -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 = []
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue