]>
jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/blob - lib/Channel.php
8 class Channel
implements Contracts\User
11 public Connection
$connection;
13 public function __construct(string $uri, string $api_login, array $options)
15 $this->connection
= new Connection($uri, $api_login, $options);
19 * Return a list of channels users.
24 public function get(): stdClass
26 $response = $this->connection
->query('channel.list');
28 if(!is_bool($response)) {
32 throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');
36 * Return a channel object
38 * @param array $params
42 public function show(array $params): stdClass
44 $response = $this->connection
->query('channel.get', ['channel' => $params['channel']]);
46 if (!is_bool($response)) {
50 throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');