Skip to content

Commit

Permalink
fix payload type
Browse files Browse the repository at this point in the history
  • Loading branch information
labi-le committed Jul 13, 2021
1 parent 56b1643 commit d2515b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Events/EventTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down

0 comments on commit d2515b5

Please sign in to comment.