. * * @author Daniil Gentili * @copyright 2016-2023 Daniil Gentili * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 * @link https://docs.madelineproto.xyz MadelineProto documentation */ namespace danog\MadelineProto\Settings; use danog\MadelineProto\SettingsAbstract; /** * Secret chat settings. */ final class SecretChats extends SettingsAbstract { /** * What secret chats to accept. * * Boolean or array of IDs * * @var bool|array */ protected bool|array $accept = true; /** * Get boolean or array of IDs. * * @return bool|array */ public function getAccept(): bool|array { return $this->accept; } /** * Set boolean or array of IDs. * * @param bool|array $accept Boolean or array of IDs */ public function setAccept(bool|array $accept): self { $this->accept = $accept; return $this; } /** * Can we accept this chat. * * @internal */ public function canAccept(int $id): bool { if (!$this->accept) { return false; } if ($this->accept === true) { return true; } return \in_array($id, $this->accept, true); } }