isundil 6 years ago
parent
commit
1816c83424
1 changed files with 18 additions and 0 deletions
  1. 18 0
      api/index.php

+ 18 - 0
api/index.php

@@ -0,0 +1,18 @@
+<?php
+
+if (isset($_GET["command"])) {
+    switch ($_GET["command"]) {
+    case "official_channels.list":
+        require("../.htconfig.php");
+        global $dblink;
+        $chanList = $dblink->query("SELECT channel, default_join FROM knacki_official;");
+        $chanList->setFetchMode(PDO::FETCH_OBJ);
+        $result = array();
+        while ($i = $chanList->fetch())
+            array_push($result, $i);
+        echo json_encode($result);
+        break;
+    }
+}
+
+?>