From 703e3add40dea9ef2ad6453ce944da2469a95c6f Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 12 Feb 2023 17:21:43 -0500 Subject: [PATCH] Updated \TgBotLib\Objects > Dice --- src/TgBotLib/Objects/Dice.php | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/TgBotLib/Objects/Dice.php diff --git a/src/TgBotLib/Objects/Dice.php b/src/TgBotLib/Objects/Dice.php new file mode 100644 index 0000000..5389946 --- /dev/null +++ b/src/TgBotLib/Objects/Dice.php @@ -0,0 +1,65 @@ +emoji; + } + + /** + * @return int + */ + public function getValue(): int + { + return $this->value; + } + + /** + * Constructs object from array representation + * + * @return array + */ + public function toArray(): array + { + return [ + 'emoji' => $this->emoji, + 'value' => $this->value, + ]; + } + + /** + * Constructs object from array representation + * + * @param array $data + * @return ObjectTypeInterface + */ + public static function fromArray(array $data): ObjectTypeInterface + { + $object = new self(); + + $object->emoji = @$data['emoji'] ?? null; + $object->value = @$data['value'] ?? null; + + return $object; + } + } \ No newline at end of file