* @return stdClass|array|bool
* @throws Exception
*/
- public function get(string $nick): stdClass|array|bool
+ public function get(string $server = null): stdClass|array|bool
{
- $response = $this->connection->query('server.get', ['server' => $nick]);
+ $response = $this->connection->query('server.get', ['server' => $server]);
if (!is_bool($response)) {
return $response->server;
* @return stdClass|array|bool
* @throws Exception
*/
- public function disconnect(string $name): stdClass|array|bool
+ public function disconnect(string $name, string $reason = "No reason"): stdClass|array|bool
{
return $this->connection->query('server.disconnect', [
'link' => $name,
+ 'reason' => $reason
]);
}
-
+
+
/**
* List modules on the server
*
* @return stdClass|array|bool
* @throws Exception
*/
- public function module_list(): stdClass|array|bool
+ public function module_list($name = NULL): stdClass|array|bool
{
- return $this->connection->query('server.module_list', [
- ]);
+ $arr = [];
+ if ($name)
+ $arr['server'] = $name;
+
+ return $this->connection->query('server.module_list', $arr);
}
}