messages.DeleteHistory

class pyrogram.raw.functions.messages.DeleteHistory

Deletes communication history.

Details:
  • Layer: 223

  • ID: B08F922A

Parameters:
  • peer (InputPeer) – User or chat, communication history of which will be deleted

  • max_id (int 32-bit) – Maximum ID of message to delete

  • just_clear (bool, optional) – Just clear history for the current user, without actually removing messages for every chat user

  • revoke (bool, optional) – Whether to delete the message history for all chat participants

  • min_date (int 32-bit, optional) – Delete all messages newer than this UNIX timestamp

  • max_date (int 32-bit, optional) – Delete all messages older than this UNIX timestamp

Returns:

messages.AffectedHistory

TL Schema

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

Parameter Tree

DeleteHistory
├── just_cleartrue (optional)
├── revoketrue (optional)
├── peerInputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_idlong
│ ├── InputPeerUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ ├── InputPeerChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ │ ├── peerInputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_idint
│ │ └── user_idlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
├── max_idint
├── min_dateint (optional)
└── max_dateint (optional)

Example

await app.invoke(
    DeleteHistory(
        just_clear=None,
        revoke=None,
        peer=await app.resolve_peer(chat_id),
        max_id=0,
        min_date=0,
        max_date=0,
    )
)