]>
jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/blob - lib/Channel.php
11 public Connection
$connection;
13 public function __construct(Connection
$conn)
15 $this->connection
= $conn;
19 * Return a list of channels users.
21 * @return stdClass|array|bool
24 public function getAll(): stdClass
|array|bool
26 $response = $this->connection
->query('channel.list');
28 if(!is_bool($response)) {
29 return $response->list;
32 throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');
36 * Get a channel object
38 * @return stdClass|array|bool
41 public function get(string $channel): stdClass
|array|bool
43 $response = $this->connection
->query('channel.get', ['channel' => $channel]);
45 if (!is_bool($response)) {
49 throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');