Layer 224
MessagesGetSavedHistory
Fetch saved messages forwarded from a specific peer, or fetch messages from a monoforum topic.
method
Users
messages.getSavedHistory#998ab009 flags:# parent_peer:flags.0?InputPeer peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
Parameters
| Name | Type | Description |
|---|---|---|
| ParentPeer | flags.0?InputPeer | If set, fetches messages from the specified monoforum, otherwise fetches from saved messages. |
| Peer | InputPeer | Target peer (or topic) |
| OffsetId | int | Only return messages starting from the specified message ID |
| OffsetDate | int | Only return messages sent before the specified date |
| AddOffset | int | Number of list elements to be skipped, negative values are also accepted. |
| Limit | int | Number of results to return |
| MaxId | int | If a positive value was transferred, the method will return only messages with IDs less than max_id |
| MinId | int | If a positive value was transferred, the method will return only messages with IDs more than min_id |
| Hash | long | Result hash |
Returns
messages.MessagesGogram Example
// MessagesGetSavedHistory - using Params struct result, err := client.MessagesGetSavedHistory(&tg.MessagesGetSavedHistoryParams{ Peer: &tg.InputPeerUser{UserID: int64(777000)}, OffsetId: 42, OffsetDate: 42, AddOffset: 42, Limit: 42, MaxId: 42, MinId: 42, Hash: int64(1234567890), // Optional fields: // ParentPeer: &tg.InputPeerUser{UserID: int64(777000)}, }) if err != nil { // handle error } // result is *tg.MessagesMessages
Possible Errors
| Code | Type | Description |
|---|---|---|
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |