updates.getDifference #

Get new updates.

Layer 223

updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
updates.differenceTooLong#4afe8f6d pts:int = updates.Difference;
---functions---
updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
ptsintPTS, see updates.
pts_limitflags.1?intPTS limit
pts_total_limitflags.0?intFor fast updating: if provided and pts + pts_total_limit < remote pts, updates.differenceTooLong will be returned.
Simply tells the server to not return the difference if it is bigger than pts_total_limit
If the remote pts is too big (> ~4000000), this field will default to 1000000
dateintdate, see updates.
qtsintQTS, see updates.
qts_limitflags.2?intQTS limit

Result #

updates.Difference

Both users and bots can use this method #

Possible errors #

CodeTypeDescription
400CDN_METHOD_INVALIDYou can't call this method in a CDN DC.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400DATE_EMPTYDate empty.
400MSG_ID_INVALIDInvalid message ID provided.
400PERSISTENT_TIMESTAMP_EMPTYPersistent timestamp empty.
400PERSISTENT_TIMESTAMP_INVALIDPersistent timestamp invalid.
500RANDOM_ID_DUPLICATEYou provided a random ID that was already used.
400USERNAME_INVALIDThe provided username is not valid.
400USER_NOT_PARTICIPANTYou're not a member of this supergroup/channel.

Working with Updates #

How to subscribe to updates and handle them properly.

updates.differenceTooLong #

The difference is too long, and the specified state must be used to refetch updates.