id = $rawMessage['id']; $this->message = $rawMessage['message'] ?? ''; $this->chatId = $this->API->getId($rawMessage); $this->date = $rawMessage['date']; $this->mentioned = $rawMessage['mentioned']; $this->silent = $rawMessage['silent']; $this->fromScheduled = $rawMessage['from_scheduled']; $this->pinned = $rawMessage['pinned']; $this->protected = $rawMessage['noforwards']; $this->viaBotId = $rawMessage['via_bot_id'] ?? null; $this->editDate = $rawMessage['edit_date'] ?? null; $this->ttlPeriod = $rawMessage['ttl_period'] ?? null; $this->entities = $rawMessage['entities']; } /** * Get an HTML version of the message. * * @param bool $allowTelegramTags Whether to allow telegram-specific tags like tg-spoiler, tg-emoji, mention links and so on... */ public function getHTML(bool $allowTelegramTags = false): string { return StrTools::messageEntitiesToHtml($this->message, $this->entities, $allowTelegramTags); } }