getValue(); } else if ($value instanceof \Raudius\Luar\Interpreter\LuarObject\Table) { return parse_lua_script($value->getValue()); } if (is_array($value)) { $out = []; foreach ($value as $k => $v) { if ($k == 'handle') { continue; } $out[$k] = parse_lua_script($v); } return $out; } return $value; } if (empty(LUA_SCRIPT_DIRECTORY)) { http_response_code(403); exit; } $command = null; $scripts = []; // loading lua scripts $luar = new Luar(); $parsedown = new Parsedown(); $file_paths = glob(LUA_SCRIPT_DIRECTORY . '/*.lua'); foreach ($file_paths as $file_path) { $script = file_get_contents($file_path); $result = $luar->eval($script); $script = parse_lua_script($result); $script['description_text'] = str_replace(PHP_EOL, ' ', $script['description']); array_push($scripts, $script); } if ($cmd_id = $_GET['id'] ?? false) { $command = array_find( $scripts, fn($x) => $x['name'] == $cmd_id || (isset($x['aliases']) ? in_array($cmd_id, $x['aliases']) : false) ); if (!$command) { http_response_code(404); exit; } } if ($command) { if (isset($command['description'])) { $command['description_formatted'] = $parsedown->text($command['description']); } } ?> <?= isset($command) ? "!{$command['name']} - Script" : 'Scripts' ?> - <?= BOT_USERNAME_FORMATTED ?>

Scripts

![code]

Delay
Subcommands "$x", $command['subcommand'])) ?>
Aliases "$x", $command['aliases'])) ?>
Minimal rights

No description.

Select a script from the list on the left.