MadelineProtoDocs/docs/API_docs/methods/account.saveRingtone.md
2024-05-01 14:53:46 +02:00

1.9 KiB

title description grand_parent parent image redirect_from
account.saveRingtone Save or remove saved notification sound. Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/account_saveRingtone.html

Method: account.saveRingtone

Back to methods index

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).

Parameters:

Name Type Description Required
id MessageMedia, Update, Message or InputDocument Notification sound uploaded using account.uploadRingtone Optional
unsave Bool Whether to add or delete the notification sound Yes

Return type: account.SavedRingtone

Can bots use this method: 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();

$account_SavedRingtone = $MadelineProto->account->saveRingtone(id: $InputDocument, unsave: $Bool, );