mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +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
|
import pyrogram
|
||||||
from pyrogram import types, raw, utils
|
from pyrogram import types, raw, utils
|
||||||
|
from pyrogram.errors import ChannelPrivate
|
||||||
|
|
||||||
|
|
||||||
class GetDialogs:
|
class GetDialogs:
|
||||||
|
|
@ -76,7 +77,10 @@ class GetDialogs:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
chat_id = utils.get_peer_id(message.peer_id)
|
chat_id = utils.get_peer_id(message.peer_id)
|
||||||
|
try:
|
||||||
messages[chat_id] = await types.Message._parse(self, message, users, chats)
|
messages[chat_id] = await types.Message._parse(self, message, users, chats)
|
||||||
|
except ChannelPrivate:
|
||||||
|
continue
|
||||||
|
|
||||||
dialogs = []
|
dialogs = []
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue