mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Fix unwanted CHANNEL_PRIVATE errors. Fixes #129
This commit is contained in:
parent
f608899c25
commit
12c61fb431
@ -43,7 +43,7 @@ from pyrogram.api.errors import (
|
||||
PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty,
|
||||
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
|
||||
PasswordHashInvalid, FloodWait, PeerIdInvalid, FirstnameInvalid, PhoneNumberBanned,
|
||||
VolumeLocNotFound, UserMigrate, FileIdInvalid)
|
||||
VolumeLocNotFound, UserMigrate, FileIdInvalid, ChannelPrivate)
|
||||
from pyrogram.client.handlers import DisconnectHandler
|
||||
from pyrogram.crypto import AES
|
||||
from pyrogram.session import Auth, Session
|
||||
@ -803,6 +803,7 @@ class Client(Methods, BaseClient):
|
||||
message = update.message
|
||||
|
||||
if not isinstance(message, types.MessageEmpty):
|
||||
try:
|
||||
diff = self.send(
|
||||
functions.updates.GetChannelDifference(
|
||||
channel=self.resolve_peer(int("-100" + str(channel_id))),
|
||||
@ -816,6 +817,8 @@ class Client(Methods, BaseClient):
|
||||
limit=pts
|
||||
)
|
||||
)
|
||||
except ChannelPrivate:
|
||||
continue
|
||||
|
||||
if not isinstance(diff, types.updates.ChannelDifferenceEmpty):
|
||||
updates.users += diff.users
|
||||
|
Loading…
Reference in New Issue
Block a user