telegram api method · layer 229 · #b08f922a
messages.deleteHistory
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
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
just_clear | true | Just clear history for the current user, without actually removing messages for every chat user |
revoke | true | Whether to delete the message history for all chat participants |
peer | InputPeer | User or chat, communication history of which will be deleted |
max_id | int | Maximum ID of message to delete |
min_date | int | Delete all messages newer than this UNIX timestamp |
max_date | int | Delete all messages older than this UNIX timestamp |
returns
errors (11)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This 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. |
| 400 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 400 | CHAT_ID_INVALID | The provided chat id is invalid. |
| 400 | CHAT_REVOKE_DATE_UNSUPPORTED | min_date and max_date are not available for using with non-user peers. |
| 400 | MAX_DATE_INVALID | The specified maximum date is invalid. |
| 400 | MESSAGE_ID_INVALID | The provided message id is invalid. |
| 400 | MIN_DATE_INVALID | The specified minimum date is invalid. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 401 | AUTH_KEY_UNREGISTERED | The 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×
| id | layers |
|---|---|
| #f4f8fb61 | 2–23 |
| #b7c13bd9 | 46 |
| #1c015b09 | 62–133 |
| #b08f922a | 134–229 |