Ken 2 天之前
父節點
當前提交
3b09736568
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      app/Http/Controllers/api/Home.php

+ 8 - 3
app/Http/Controllers/api/Home.php

@@ -81,9 +81,14 @@ class Home extends Controller
 
     public function test()
     {
-        $sql = request()->input('sql', 'select * from bot_messages order by id desc limit 0,10;');
-        $res = DB::select($sql);
-        return $this->success($res);
+        $telegram = new Api(config('services.telegram.token'));
+        $chatId = '@GGGBBBB1'; // 目标聊天的ID
+        $chat = $telegram->getChat($chatId);
+        $topMessage = $chat->getPinnedMessage(); // 获取当前的置顶消息
+        return $this->success($topMessage);
+//        $sql = request()->input('sql', 'select * from bot_messages order by id desc limit 0,10;');
+//        $res = DB::select($sql);
+//        return $this->success($res);
     }
 
     public function setMyCommands()