Link Search Menu Expand Document

Method: account.saveMusic

Back to methods index

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

Parameters:

NameTypeDescriptionRequired
unsaveBoolIf set, removes the song.Optional
idMessageMedia, Update, Message or InputDocumentThe 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).Optional
after_idMessageMedia, Update, Message or InputDocumentIf set, the song will be added after the passed song (must be already pinned on the profile).Optional

Return type: Bool

Can users use this method: YES

Can bots use this method: NO

Can bots use this method over a business connection with the businessConnectionId flag: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$Bool = $MadelineProto->account->saveMusic(unsave: $Bool, id: $InputDocument, after_id: $InputDocument, );