Layer 220
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 |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| 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.MessagesPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
Gogram Example
// MessagesGetSavedHistory - using Params struct result, err := client.MessagesGetSavedHistory(&tg.MessagesGetSavedHistoryParams{ Peer: &tg.InputPeerUser{UserID: int64(123456789)}, OffsetId: 0, OffsetDate: 0, AddOffset: 0, Limit: 0, MaxId: 0, MinId: 0, Hash: int64(0), // Optional fields: // ParentPeer: &tg.InputPeerUser{UserID: int64(123456789)}, }) if err != nil { // handle error } // result is *tg.MessagesMessages