|
|
@@ -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()
|