]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/blobdiff - lib/Channel.php
Return from $rpc->eventloop() after 2 seconds instead of 10.
[irc/unrealircd/unrealircd-rpc-php.git] / lib / Channel.php
index 4e9db459b661f1877cadf8d1074f872b1a7ecc23..7a6a68e81b0d83d77b5ddeb8dc59d0c8d6c1397d 100644 (file)
@@ -21,9 +21,11 @@ class Channel
      * @return stdClass|array|bool
      * @throws Exception
      */
-    public function getAll(): stdClass|array|bool
+    public function getAll(int $object_detail_level=1): stdClass|array|bool
     {
-        $response = $this->connection->query('channel.list');
+        $response = $this->connection->query('channel.list', [
+            'object_detail_level' => $object_detail_level,
+        ]);
 
         if(!is_bool($response)) {
             return $response->list;
@@ -37,9 +39,12 @@ class Channel
      *
      * @return stdClass|array|bool
      */
-    public function get(string $channel): stdClass|array|bool
+    public function get(string $channel, int $object_detail_level=3): stdClass|array|bool
     {
-        $response = $this->connection->query('channel.get', ['channel' => $channel]);
+        $response = $this->connection->query('channel.get', [
+            'channel' => $channel,
+            'object_detail_level' => $object_detail_level,
+        ]);
 
         if (!is_bool($response)) {
             return $response->channel;