You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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])); } } } }
The text was updated successfully, but these errors were encountered:
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])); } } } }
The text was updated successfully, but these errors were encountered: