Skip to main content

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

NameTypeRequiredDescription
PeriodintyesThe new default Time-To-Live of all messages sent in new chats, in seconds.

Returns

bool

Possible errors

CodeTypeDescription
400TTL_PERIOD_INVALIDThe specified TTL period is invalid.

References