* Add a ban.
*
* @param string $user
- * @return stdClass
+ * @return stdClass|array|bool
* @throws Exception
*/
- public function add(string $name, string $type, string $duration, string $reason): stdClass
+ public function add(string $name, string $type, string $duration, string $reason): stdClass|array|bool
{
return $this->connection->query('server_ban.add', [
'name' => $name,
* Delete a ban.
*
* @param string $name
- * @return stdClass
+ * @return stdClass|array|bool
* @throws Exception
*/
- public function delete(string $name, string $type): stdClass
+ public function delete(string $name, string $type): stdClass|array|bool
{
return $this->connection->query('server_ban.del', [
'name' => $name,
/**
* Return a list of all bans.
*
- * @return stdClass
+ * @return stdClass|array|bool
* @throws Exception
*/
- public function getAll(): stdClass
+ public function getAll(): stdClass|array|bool
{
$response = $this->connection->query('server_ban.list');
if (!is_bool($response)) {
- return $response;
+ return $response->list;
}
throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');
/**
* Get a specific ban.
*
- * @param array $params
- * @return stdClass
+ * @return stdClass|array|bool
* @throws Exception
*/
- public function get(array $params): stdClass
+ public function get(string $name, string $type): stdClass|array|bool
{
$response = $this->connection->query('server_ban.get', [
- 'name' => $params['name'],
- 'type' => $params['type']
+ 'name' => $name,
+ 'type' => $type
]);
if (!is_bool($response)) {