no message

This commit is contained in:
hellcat 2025-03-20 22:47:50 +08:00
parent 2d063b33be
commit 173a18f10e

View File

@ -19,7 +19,7 @@ final class HookController
public $sApiToken; public $sApiToken;
public $sApiChatId; public $sApiChatId;
public function cmd(Request $request) public function cmd()
{ {
$this->sApiToken = Config::obtain('telegram_token'); $this->sApiToken = Config::obtain('telegram_token');
$this->sApiChatId = Config::obtain('telegram_chatid'); $this->sApiChatId = Config::obtain('telegram_chatid');
@ -50,6 +50,7 @@ final class HookController
// 发送消息到 Telegram // 发送消息到 Telegram
$this->sendMessage("服务器时间: " . $serverTime); $this->sendMessage("服务器时间: " . $serverTime);
http_response_code(200);exit;
} }
if (strpos($message, '/reply') === 0) { if (strpos($message, '/reply') === 0) {
@ -67,6 +68,8 @@ final class HookController
// 发送消息到 Telegram // 发送消息到 Telegram
$this->sendMessage($replyMessage); $this->sendMessage($replyMessage);
} }
http_response_code(200);exit;
} }
// if ($message === "/reply") { // if ($message === "/reply") {
@ -84,7 +87,7 @@ final class HookController
// //
// } // }
return response()->json(['status' => 'success'], 200); http_response_code(200);exit;
} }