. * * @author Amir Hossein Jafari * @copyright 2016-2023 Amir Hossein Jafari * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 * @link https://docs.madelineproto.xyz MadelineProto documentation */ namespace danog\MadelineProto\EventHandler; use danog\MadelineProto\EventHandler\Privacy\AbstractRule; use danog\MadelineProto\EventHandler\Privacy\Key; use danog\MadelineProto\MTProto; /** * Privacy rules were changed. */ final class Privacy extends Update { /** @var Key Peers to which the privacy rules apply */ public readonly Key $key; /** @var list New privacy rules. */ public readonly array $rules; /** @internal */ public function __construct(MTProto $API, array $rawPrivacy) { parent::__construct($API); $this->key = Key::fromRawKey($rawPrivacy['key']['_']); $this->rules = array_map(AbstractRule::fromRawRule(...), $rawPrivacy['rules']); } }