*/
public function add(string $name, string $match_type, string $spamfilter_targets, string $ban_action, string $ban_duration, string $reason): stdClass|array|bool
{
- return $this->connection->query('spamfilter.add', [
+ $response = $this->connection->query('spamfilter.add', [
'name' => $name,
'match_type' => $match_type,
'spamfilter_targets' => $spamfilter_targets,
'ban_duration' => $ban_duration,
'reason' => $reason,
]);
+ if (property_exists($response, 'tkl'))
+ return $response->tkl;
+ return FALSE;
}
/**
*/
public function delete(string $name, string $match_type, string $spamfilter_targets, string $ban_action): stdClass|array|bool
{
- return $this->connection->query('spamfilter.del', [
+ $response = $this->connection->query('spamfilter.del', [
'name' => $name,
'match_type' => $match_type,
'spamfilter_targets' => $spamfilter_targets,
'ban_action' => $ban_action,
]);
+ if (property_exists($response, 'tkl'))
+ return $response->tkl;
+ return FALSE;
}
/**
]);
if (!is_bool($response)) {
- return $response;
+ return $response->tkl;
}
throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');