seven 5 ngày trước cách đây
mục cha
commit
79ea432648
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  1. 12 0
      app/Http/Controllers/api/Home.php

+ 12 - 0
app/Http/Controllers/api/Home.php

@@ -99,6 +99,18 @@ class Home extends Controller
         return $this->success();
     }
 
+    public function setMenuButton()
+    {
+        try {
+            $telegram = new Api(config('services.telegram.token'));
+            $res = $telegram->setMenuButton(['text' => '菜单', 'web_app' => ['url' => url('/api/onMessage')]]);
+        } catch (TelegramSDKException $e) {
+            return $this->error($e->getCode(), $e->getMessage());
+        }
+
+        return $this->success($res);
+    }
+
     public function getUpdates()
     {
         try {