Add command to get chatid
authorCameron Ball <cameron@cameron1729.xyz>
Sun, 18 Nov 2018 04:43:40 +0000 (12:43 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Sun, 18 Nov 2018 04:43:40 +0000 (12:43 +0800)
purjolok.php

index 69e22d4..21eb7b5 100644 (file)
@@ -16,6 +16,19 @@ use Telegram\Bot\Commands\Command;
 
 getTelegram()->addCommand(
     new class extends Command {
+        protected $name = 'chatid';
+        protected $description = 'Get the id for this chat.';
+
+        public function handle($arguments) {
+            $this->replyWithMessage([
+                'text' => $this->getUpdate()->get('message')->get('chat')->get('id')
+            ]);
+        }
+    }
+);
+
+getTelegram()->addCommand(
+    new class extends Command {
         protected $name = 'mybills';
         protected $description = 'List my bills';