mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +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,
|
PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty,
|
||||||
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
|
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
|
||||||
PasswordHashInvalid, FloodWait, PeerIdInvalid, FirstnameInvalid, PhoneNumberBanned,
|
PasswordHashInvalid, FloodWait, PeerIdInvalid, FirstnameInvalid, PhoneNumberBanned,
|
||||||
VolumeLocNotFound, UserMigrate, FileIdInvalid)
|
VolumeLocNotFound, UserMigrate, FileIdInvalid, ChannelPrivate)
|
||||||
from pyrogram.client.handlers import DisconnectHandler
|
from pyrogram.client.handlers import DisconnectHandler
|
||||||
from pyrogram.crypto import AES
|
from pyrogram.crypto import AES
|
||||||
from pyrogram.session import Auth, Session
|
from pyrogram.session import Auth, Session
|
||||||
@ -803,19 +803,22 @@ class Client(Methods, BaseClient):
|
|||||||
message = update.message
|
message = update.message
|
||||||
|
|
||||||
if not isinstance(message, types.MessageEmpty):
|
if not isinstance(message, types.MessageEmpty):
|
||||||
diff = self.send(
|
try:
|
||||||
functions.updates.GetChannelDifference(
|
diff = self.send(
|
||||||
channel=self.resolve_peer(int("-100" + str(channel_id))),
|
functions.updates.GetChannelDifference(
|
||||||
filter=types.ChannelMessagesFilter(
|
channel=self.resolve_peer(int("-100" + str(channel_id))),
|
||||||
ranges=[types.MessageRange(
|
filter=types.ChannelMessagesFilter(
|
||||||
min_id=update.message.id,
|
ranges=[types.MessageRange(
|
||||||
max_id=update.message.id
|
min_id=update.message.id,
|
||||||
)]
|
max_id=update.message.id
|
||||||
),
|
)]
|
||||||
pts=pts - pts_count,
|
),
|
||||||
limit=pts
|
pts=pts - pts_count,
|
||||||
|
limit=pts
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
except ChannelPrivate:
|
||||||
|
continue
|
||||||
|
|
||||||
if not isinstance(diff, types.updates.ChannelDifferenceEmpty):
|
if not isinstance(diff, types.updates.ChannelDifferenceEmpty):
|
||||||
updates.users += diff.users
|
updates.users += diff.users
|
||||||
|
Loading…
x
Reference in New Issue
Block a user