no message

This commit is contained in:
hellcat 2025-03-20 20:31:32 +08:00
parent 72a0c52133
commit 89b98e102d
2 changed files with 40 additions and 1 deletions

View File

@ -30,6 +30,45 @@ final class TestController extends BaseController
exit('x');
}
$url = 'https://fuc.loc/api/tg/hook';
$data = [
'message' => [
'chat' => [
'id' => '123456789'
],
'text' => '/test'
]
];
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data),
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
die('Error');
}
echo $result;
exit;
$jobs = new CronService();
$jobs->bandwidthMerge();

View File

@ -11,7 +11,7 @@ namespace App\Controllers\TomApi\Tg;
use App\Models\Config;
final class HookController extends BaseController
final class HookController
{
public $sApiToken;