diff --git a/src/TgBotLib/Objects/Telegram/InaccessibleMessage.php b/src/TgBotLib/Objects/Telegram/InaccessibleMessage.php new file mode 100644 index 0000000..2830a53 --- /dev/null +++ b/src/TgBotLib/Objects/Telegram/InaccessibleMessage.php @@ -0,0 +1,57 @@ +chat; + } + + /** + * Unique message identifier inside the chat + * + * @return int + */ + public function getMessageId(): int + { + return $this->message_id; + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return [ + 'chat' => $this->chat->toArray(), + 'message_id' => $this->message_id, + 'date' => $this->date + ]; + } + + /** + * @inheritDoc + */ + public static function fromArray(array $data): InaccessibleMessage + { + $object = new self(); + + $object->chat = isset($data['chat']) ? Chat::fromArray($data['chat']) : null; + $object->message_id = $data['message_id']; + $object->date = $data['data']; + + return $object; + } +} \ No newline at end of file