messages.GetHistory

class pyrogram.raw.functions.messages.GetHistory

Returns the conversation history with one interlocutor / within a chat

Details:
  • Layer: 227

  • 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
├── peer → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── offset_id → int
├── offset_date → int
├── add_offset → int
├── limit → int
├── max_id → int
├── min_id → int
└── hash → long

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,
    )
)