diff --git a/src/TgBotLib/Objects/Telegram/Poll.php b/src/TgBotLib/Objects/Telegram/Poll.php index 35a7dfb..81b1b4a 100644 --- a/src/TgBotLib/Objects/Telegram/Poll.php +++ b/src/TgBotLib/Objects/Telegram/Poll.php @@ -247,7 +247,6 @@ $object->id = $data['id'] ?? null; $object->question = $data['question'] ?? null; - $object->options = $data['options'] ?? null; $object->total_voter_count = $data['total_voter_count'] ?? null; $object->is_closed = $data['is_closed'] ?? null; $object->is_anonymous = $data['is_anonymous'] ?? null; @@ -268,6 +267,16 @@ } } + $object->options = null; + if(isset($data['options']) && is_array($data['options'])) + { + $object->options = []; + foreach($data['options'] as $option) + { + $object->options[] = PollOption::fromArray($option); + } + } + return $object; } } \ No newline at end of file