From c5009e41b5db7e3464d3e1e4eaffdd32d7000a01 Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Sun, 18 Nov 2018 12:43:40 +0800 Subject: [PATCH] Add command to get chatid --- purjolok.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/purjolok.php b/purjolok.php index 69e22d4..21eb7b5 100644 --- a/purjolok.php +++ b/purjolok.php @@ -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'; -- 2.11.0