public function __construct(array $data, $bot_name)
{
// Make sure we don't double-save the raw_data
unset($data['raw_data']);
$data['raw_data'] = $data;
$is_ok = isset($data['ok']) ? (bool) $data['ok'] : false;
$result = isset($data['result']) ? $data['result'] : null;
if ($is_ok && is_array($result)) {
if ($this->isAssoc($result)) {
$data['result'] = $this->createResultObject($result, $bot_name);
} else {
$data['result'] = $this->createResultObjects($result, $bot_name);
}
}
parent::__construct($data, $bot_name);
}