]> 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 2a3f9e5fa8d0c298643613989f3e39611fcf93c3..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;
@@ -84,7 +89,7 @@ class Channel
      */
     public function kick(string $channel, string $nick, string $reason): stdClass|array|bool
     {
-        return $this->connection->query('user.kick', [
+        return $this->connection->query('channel.kick', [
             'nick' => $nick,
             'channel' => $channel,
             'reason' => $reason,