Add a command to generate the hash list
authorCameron Ball <cameron@cameron1729.xyz>
Sun, 5 May 2019 07:03:28 +0000 (15:03 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Sun, 5 May 2019 07:03:28 +0000 (15:03 +0800)
src/gnb.php

index 8160750..97e2793 100644 (file)
@@ -69,4 +69,22 @@ getTelegram()->addCommand(
     }
 );
 
+getTelegram()->addCommand(
+    new class extends Command {
+        protected $name = 'hashgen';
+        protected $description = 'Generate the songs hash';
+
+        public function handle($arguments) {
+            $this->replyWithMessage(
+                [
+                    'text' => "Building songs hash... This will take a while."
+                ]
+            );
+
+            exec('/root/hashghen.sh');
+        }
+    }
+);
+
+
 getTelegram()->commandsHandler(true); //must come afterwards because lolzer