Skip to main content

messages.deleteSavedHistory

Deletes messages from a monoforum topic », or deletes messages forwarded from a specific peer to saved messages ».

func (c *Client) MessagesDeleteSavedHistory(ctx context.Context, request *MessagesDeleteSavedHistoryRequest) (*MessagesAffectedHistory, error)

Calling this method​

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesDeleteSavedHistory(ctx, &tg.MessagesDeleteSavedHistoryRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *MessagesAffectedHistory
return nil
})

Parameters​

NameTypeRequiredDescription
ParentPeerInputPeerClass—If set, affects the messages of the passed monoforum topic », otherwise affects saved messages ».
PeerInputPeerClassyesPeer, whose messages will be deleted from saved messages », or the ID of the topic.
MaxIDintyesMaximum ID of message to delete
MinDateint—Delete all messages newer than this UNIX timestamp
MaxDateint—Delete all messages older than this UNIX timestamp

Returns​

*MessagesAffectedHistory

Possible errors​

CodeTypeDescription
400PEER_ID_INVALIDThe provided peer id is invalid.

References​