Skip to content

Commit ab14185

Browse files
committed
Bugfix when raw_data is not in sync with actual data
1 parent ba43051 commit ab14185

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Entities/Entity.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ public function __construct(array $data, string $bot_username = '')
5959
*/
6060
public function jsonSerialize(): array
6161
{
62-
return $this->getRawData();
62+
$data = get_object_vars($this);
63+
64+
// Delete unnecessary data
65+
unset($data['raw_data']);
66+
unset($data['bot_username']);
67+
68+
return $data;
6369
}
6470

6571
/**

0 commit comments

Comments
 (0)