messages.GetHistory

class pyrogram.raw.functions.messages.GetHistory

Returns the conversation history with one interlocutor / within a chat

Details:
  • Layer: 223

  • ID: 4423E6C5

Parameters:
  • peer (InputPeer) – Target peer

  • offset_id (int 32-bit) – Only return messages starting from the specified message ID

  • offset_date (int 32-bit) – Only return messages sent before the specified date

  • add_offset (int 32-bit) – Number of list elements to be skipped, negative values are also accepted.

  • limit (int 32-bit) – Number of results to return

  • max_id (int 32-bit) – If a positive value was transferred, the method will return only messages with IDs less than max_id

  • min_id (int 32-bit) – If a positive value was transferred, the method will return only messages with IDs more than min_id

  • hash (int 64-bit) – Result hash

Returns:

messages.Messages

TL Schema

messages.getHistory#4423e6c5
peer:InputPeer
offset_id:int
offset_date:int
add_offset:int
limit:int
max_id:int
min_id:int
hash:long

= messages.Messages

Parameter Tree

GetHistory
├── 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
├── offset_idint
├── offset_dateint
├── add_offsetint
├── limitint
├── max_idint
├── min_idint
└── hashlong

Example

await app.invoke(
    GetHistory(
        peer=await app.resolve_peer(chat_id),
        offset_id=0,
        offset_date=0,
        add_offset=0,
        limit=0,
        max_id=0,
        min_id=0,
        hash=0,
    )
)