Skip to main content

account.saveRingtone

Save or remove saved notification sound. If the notification sound is already in MP3 format, account.savedRingtone will be returned. Otherwise, it will be automatically converted and a account.savedRingtoneConverted will be returned, containing a new document object that should be used to refer to the ringtone from now on (ie when deleting it using the unsave parameter, or when downloading it).

func (c *Client) AccountSaveRingtone(ctx context.Context, request *AccountSaveRingtoneRequest) (AccountSavedRingtoneClass, error)

Calling this method

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

res, err := api.AccountSaveRingtone(ctx, &tg.AccountSaveRingtoneRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // AccountSavedRingtoneClass
return nil
})

Parameters

NameTypeRequiredDescription
IDInputDocumentClassyesNotification sound uploaded using account.uploadRingtone
UnsaveboolyesWhether to add or delete the notification sound

Returns

AccountSavedRingtoneClass

Possible errors

CodeTypeDescription
400RINGTONE_INVALIDThe specified ringtone is invalid.

References