qts_count is always assumed to be 1

Per the docs https://core.telegram.org/api/updates:
> events are never grouped,
> so it's assumed that qts_count is always equal to 1.
This commit is contained in:
Lonami Exo 2024-06-04 23:01:23 +02:00
parent b8d656efa5
commit 751b537fe1

View File

@ -232,12 +232,12 @@ def pts_info_from_update(update: abcs.Update) -> Optional[PtsInfo]:
elif isinstance(update, types.UpdatePinnedChannelMessages): elif isinstance(update, types.UpdatePinnedChannelMessages):
return PtsInfo(update.channel_id, update.pts, update.pts_count) return PtsInfo(update.channel_id, update.pts, update.pts_count)
elif isinstance(update, types.UpdateChatParticipant): elif isinstance(update, types.UpdateChatParticipant):
return PtsInfo(ENTRY_SECRET, update.qts, 0) return PtsInfo(ENTRY_SECRET, update.qts, 1)
elif isinstance(update, types.UpdateChannelParticipant): elif isinstance(update, types.UpdateChannelParticipant):
return PtsInfo(ENTRY_SECRET, update.qts, 0) return PtsInfo(ENTRY_SECRET, update.qts, 1)
elif isinstance(update, types.UpdateBotStopped): elif isinstance(update, types.UpdateBotStopped):
return PtsInfo(ENTRY_SECRET, update.qts, 0) return PtsInfo(ENTRY_SECRET, update.qts, 1)
elif isinstance(update, types.UpdateBotChatInviteRequester): elif isinstance(update, types.UpdateBotChatInviteRequester):
return PtsInfo(ENTRY_SECRET, update.qts, 0) return PtsInfo(ENTRY_SECRET, update.qts, 1)
else: else:
return None return None