public static function fromArray(array $arr): self
    {
        $prop = $arr + (new self($arr['text'] ?? ''))->toArray();
        foreach ($prop['attachments'] as &$attachment) {
            if (!$attachment instanceof AttachmentInterface) {
                $attachment = Attachment::fromArray($attachment);
            }
        }
        unset($attachment);

        return self::__set_state($prop);
    }