telegram api method · layer 229 · #b08f922a

messages.deleteHistory

usable by users

Deletes communication history.

definition

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

returns

messages.AffectedHistory

errors (11)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
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.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).

history

present in layers 2–229 · constructor id changed 3×

idlayers
#f4f8fb612–23
#b7c13bd946
#1c015b0962–133
#b08f922a134–229