messages.getSavedHistory
Fetch saved messages » forwarded from a specific peer, or fetch messages from a monoforum topic ».
func (c *Client) MessagesGetSavedHistory(ctx context.Context, request *MessagesGetSavedHistoryRequest) (MessagesMessagesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesGetSavedHistory(ctx, &tg.MessagesGetSavedHistoryRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // MessagesMessagesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ParentPeer | InputPeerClass | — | If set, fetches messages from the specified monoforum, otherwise fetches from saved messages. |
Peer | InputPeerClass | yes | Target peer (or topic) |
OffsetID | int | yes | Only return messages starting from the specified message ID |
OffsetDate | int | yes | Only return messages sent before the specified date |
AddOffset | int | yes | Number of list elements to be skipped, negative values are also accepted. |
Limit | int | yes | Number of results to return |
MaxID | int | yes | If a positive value was transferred, the method will return only messages with IDs less than max_id |
MinID | int | yes | If a positive value was transferred, the method will return only messages with IDs more than min_id |
Hash | int64 | yes | Result hash |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.getSavedHistory#998ab009