id = $rawMessage['id']; $this->message = $rawMessage['message'] ?? ''; $this->senderId = isset($rawMessage['from_id']) ? $this->API->getId($rawMessage['from_id']) : null; $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; } /** @internal */ public static function fromRawUpdate( MTProto $API, array $rawMessage ): ?self { return ($rawMessage['out'] ?? false) ? new OutgoingMessage($API, $rawMessage) : new IncomingMessage($API, $rawMessage); } }