mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-06 15:14:52 +00:00
Catch PeerIdInvalid in get_dialogs
This commit is contained in:
parent
d7018d8ed1
commit
dd9ae86d8b
1 changed files with 2 additions and 2 deletions
|
|
@ -21,7 +21,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
|
from pyrogram.errors import ChannelPrivate, PeerIdInvalid
|
||||||
|
|
||||||
|
|
||||||
class GetDialogs:
|
class GetDialogs:
|
||||||
|
|
@ -80,7 +80,7 @@ class GetDialogs:
|
||||||
chat_id = utils.get_peer_id(message.peer_id)
|
chat_id = utils.get_peer_id(message.peer_id)
|
||||||
try:
|
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:
|
except (ChannelPrivate, PeerIdInvalid):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
dialogs = []
|
dialogs = []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue