mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Don't process empty messages
This commit is contained in:
parent
61ba9dca8b
commit
5bf64ac444
@ -634,22 +634,25 @@ class Client:
|
|||||||
pts_count = getattr(update, "pts_count", None)
|
pts_count = getattr(update, "pts_count", None)
|
||||||
|
|
||||||
if isinstance(update, types.UpdateNewChannelMessage):
|
if isinstance(update, types.UpdateNewChannelMessage):
|
||||||
diff = self.send(
|
message = update.message
|
||||||
functions.updates.GetChannelDifference(
|
|
||||||
channel=self.resolve_peer(update.message.to_id.channel_id),
|
|
||||||
filter=types.ChannelMessagesFilter(
|
|
||||||
ranges=[types.MessageRange(
|
|
||||||
min_id=update.message.id,
|
|
||||||
max_id=update.message.id
|
|
||||||
)]
|
|
||||||
),
|
|
||||||
pts=pts - pts_count,
|
|
||||||
limit=pts
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
updates.users += diff.users
|
if not isinstance(message, types.MessageEmpty):
|
||||||
updates.chats += diff.chats
|
diff = self.send(
|
||||||
|
functions.updates.GetChannelDifference(
|
||||||
|
channel=self.resolve_peer(update.message.to_id.channel_id),
|
||||||
|
filter=types.ChannelMessagesFilter(
|
||||||
|
ranges=[types.MessageRange(
|
||||||
|
min_id=update.message.id,
|
||||||
|
max_id=update.message.id
|
||||||
|
)]
|
||||||
|
),
|
||||||
|
pts=pts - pts_count,
|
||||||
|
limit=pts
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
updates.users += diff.users
|
||||||
|
updates.chats += diff.chats
|
||||||
|
|
||||||
if channel_id and pts:
|
if channel_id and pts:
|
||||||
if channel_id not in self.channels_pts:
|
if channel_id not in self.channels_pts:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user