messages.setDefaultHistoryTTL
Changes the default value of the Time-To-Live setting, applied to all new chats.
func (c *Client) MessagesSetDefaultHistoryTTL(ctx context.Context, period int) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesSetDefaultHistoryTTL(ctx, period)
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Period | int | yes | The new default Time-To-Live of all messages sent in new chats, in seconds. |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | TTL_PERIOD_INVALID | The specified TTL period is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.setDefaultHistoryTTL#9eb51445