messages.setHistoryTTL
Set maximum Time-To-Live of all messages in the specified chat
func (c *Client) MessagesSetHistoryTTL(ctx context.Context, request *MessagesSetHistoryTTLRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesSetHistoryTTL(ctx, &tg.MessagesSetHistoryTTLRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Peer | InputPeerClass | yes | The dialog |
Period | int | yes | Automatically delete all messages sent in the chat after this many seconds |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_NOT_MODIFIED | No changes were made to chat information because the new information you passed is identical to the current information. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | TTL_PERIOD_INVALID | The specified TTL period is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.setHistoryTTL#b80e5fe4