-
Notifications
You must be signed in to change notification settings - Fork 336
Description
Telegram API sends an empty object ({}) in JSON for the properties forum_topic_created, forum_topic_closed, and forum_topic_reopened when creating, closing, or reopening a topic. This causes the current implementation to ignore these events.
Proposed Fix
Update the map method as follows:
Old Code:
public function map($data) { foreach (static::$map as $key => $item) { if (isset($data[$key]) && (!is_array($data[$key]) || !empty($data[$key]))) { $method = 'set' . self::toCamelCase($key); if ($item === true) { $this->$method($data[$key]); } else { $this->$method($item::fromResponse($data[$key])); } } } }
New Code:
public function map($data) { foreach (static::$map as $key => $item) { if (isset($data[$key]) && !is_null($data[$key]) && $data[$key] !== '') { $method = 'set' . self::toCamelCase($key); if ($item === true) { $this->$method($data[$key]); } else { $this->$method($item::fromResponse($data[$key])); } } } }