* Add a spamfilter.
*
* @return stdClass|array|bool
- * @throws Exception
*/
public function add(string $name, string $match_type, string $spamfilter_targets, string $ban_action, string $ban_duration, string $reason): stdClass|array|bool
{
'ban_duration' => $ban_duration,
'reason' => $reason,
]);
+
+ if (is_bool($response))
+ return false;
+
if (property_exists($response, 'tkl'))
return $response->tkl;
return FALSE;
* Delete a spamfilter.
*
* @return stdClass|array|bool
- * @throws Exception
*/
public function delete(string $name, string $match_type, string $spamfilter_targets, string $ban_action): stdClass|array|bool
{
'spamfilter_targets' => $spamfilter_targets,
'ban_action' => $ban_action,
]);
+
+ if (is_bool($response))
+ return false;
+
if (property_exists($response, 'tkl'))
return $response->tkl;
return FALSE;
* Get a specific spamfilter.
*
* @return stdClass|array|bool
- * @throws Exception
*/
public function get(string $name, string $match_type, string $spamfilter_targets, string $ban_action): stdClass|array|bool
{
return $response->tkl;
}
- throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');
+ return false; // not found
}
}