|
|
@@ -83,8 +83,21 @@ class Home extends Controller
|
|
|
{
|
|
|
$telegram = new Api(config('services.telegram.token'));
|
|
|
$chatId = '@GGGBBBB1'; // 目标聊天的ID
|
|
|
+
|
|
|
+ $response = $telegram->sendMessage([
|
|
|
+ 'chat_id' => $chatId,
|
|
|
+ 'text' => "指定消息"
|
|
|
+ ]);
|
|
|
+ $messageId = $response->get('message_id');
|
|
|
+ // 置顶消息
|
|
|
+ $telegram->pinChatMessage([
|
|
|
+ 'chat_id' => $chatId,
|
|
|
+ 'message_id' => $messageId
|
|
|
+ ]);
|
|
|
+
|
|
|
$chat = $telegram->getChat(['chat_id' => $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);
|