Skip to main content

account.saveMusic

Adds or removes a song from the current user's profile see here » for more info on the music tab of the profile page.

func (c *Client) AccountSaveMusic(ctx context.Context, request *AccountSaveMusicRequest) (bool, error)

Calling this method

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

res, err := api.AccountSaveMusic(ctx, &tg.AccountSaveMusicRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
UnsaveboolIf set, removes the song.
IDInputDocumentClassyesThe song to add or remove; can be an already added song when reordering songs with after_id. Adding an already added song will never re-add it, only move it to the top of the song list (or after the song passed in after_id).
AfterIDInputDocumentClassIf set, the song will be added after the passed song (must be already pinned on the profile).

Returns

bool

Possible errors

CodeTypeDescription
400DOCUMENT_INVALIDThe specified document is invalid.

References