Method: 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.
Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
| unsave | Bool | If set, removes the song. | Optional |
| id | MessageMedia, Update, Message or InputDocument | The 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_id | MessageMedia, Update, Message or InputDocument | If 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, );