diff --git a/src/Events/EventTrait.php b/src/Events/EventTrait.php index 2d54063..ce5a6d1 100644 --- a/src/Events/EventTrait.php +++ b/src/Events/EventTrait.php @@ -24,6 +24,14 @@ public function __construct(object $data) $this->chat_id = $value - 2000000000; } + if ($property === "payload") { + if (is_object($value)) { + $this->payload = $value; + } elseif (is_string($value)) { + $this->payload = json_encode($value, false); + } + } + $this->$property = $value; } });