messages.deleteHistory #

Deletes communication history.

Layer 223

messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
---functions---
messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
just_clearflags.0?trueJust clear history for the current user, without actually removing messages for every chat user
revokeflags.1?trueWhether to delete the message history for all chat participants
peerInputPeerUser or chat, communication history of which will be deleted
max_idintMaximum ID of message to delete
min_dateflags.2?intDelete all messages newer than this UNIX timestamp
max_dateflags.3?intDelete all messages older than this UNIX timestamp

Result #

messages.AffectedHistory

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400CHAT_REVOKE_DATE_UNSUPPORTEDmin_date and max_date are not available for using with non-user peers.
400MAX_DATE_INVALIDThe specified maximum date is invalid.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400MIN_DATE_INVALIDThe specified minimum date is invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.