Link Search Menu Expand Document

Method: account.changeAuthorizationSettings

Back to methods index

Change authorization settings

Parameters:

NameTypeDescriptionRequired
hashlongSession ID from the authorization constructor, fetchable using account.getAuthorizationsYes
encrypted_requests_disabledBoolWhether to enable or disable receiving encrypted chats: if the flag is not set, the previous setting is not changedOptional
call_requests_disabledBoolWhether to enable or disable receiving calls: if the flag is not set, the previous setting is not changedOptional

Return type: Bool

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();

// PHP 8+ syntax, use an array on PHP 7.
$Bool = $MadelineProto->account->changeAuthorizationSettings(hash: long, encrypted_requests_disabled: Bool, call_requests_disabled: Bool, );