no message

This commit is contained in:
hellcat 2025-07-07 13:41:03 +08:00
parent 55cface7a2
commit ac2bbe27bf
6 changed files with 55 additions and 6 deletions

View File

@ -58,9 +58,9 @@ class TestsController
@$k = $_GET["k"];
@$s = $_GET["s"];
if ($k !== "wocaonide") {
exit("?");
}
// if ($k !== "wocaonide") {
// exit("?");
// }
$s = '/'.$s;
@ -69,6 +69,10 @@ class TestsController
// $s = "\/git#LastTime 1";
$s= "/test#cron__i 07";
$s = "/dog#list";
$s = "/dog#github 1";
$oHttp = new Http();
$oHttp->sMethod = "post";
$oHttp->sToUrl = env("APP_URL")."/api/tg/hook";

View File

@ -3,7 +3,27 @@
namespace App\Services\TG\Hook\Mod;
use App\Models\Article as ModelArticle;
class Article extends Base {
class Dog extends Base {
public function Github($aParam)
{
$iId = $aParam["aArg"][1] ?? false;
if (empty($aParam["aOption"]) && empty($aParam["aArg"])) {
return "/dog#github {id}";
}
$oArticle = ModelArticle::find($iId);
// https://api.github.com/repos/v2rayclashfree-com/v2rayclashfree
$this->oHttp->sToUrl = "https://api.github.com/repos/".$oArticle->user_name."/".$oArticle->project_name;
$this->oHttp->sMetHod = "get";
$this->oHttp->bIsJson = true;
$r = $this->oHttp->send();
tomd($r);
}
public function List($aParam)
{

View File

@ -0,0 +1,21 @@
<?php
namespace App\Services\TG\Hook\Mod;
use App\Models\Article as ModelArticle;
class Tom extends Base {
public function me()
{
$str = "";
$str .= "
status=0,暂停
id可以修改
";
}
}

View File

@ -57,6 +57,10 @@ class Http
// 默认使用 GET 请求
curl_setopt($ch, CURLOPT_HTTPGET, true); // 设置为 GET 请求
curl_setopt($ch, CURLOPT_URL, $this->sToUrl . '?' . http_build_query($this->aData)); // 设置请求 URL
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'User-Agent: JohnDoeDev' // 替换为你的应用名称
]);
if ($this->bIsJson) {
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json' // 设置接受的内容类型为 JSON

View File

@ -1,5 +1,5 @@
{
"id": 1003,
"id": 105,
"user_name": "telegram",
"project_name": "windows-clash-v2ray",
"mail_name": "haoliugen1212",

View File

@ -11,7 +11,7 @@ Route::get('/cron', [CronController::class, 'index']);
Route::get('/test/hello', [TestsController::class, 'hello']);
Route::get('/tests/hook', [TestsController::class, 'hook']);
Route::get('/test/hook', [TestsController::class, 'hook']);
//Route::post('/api/tg/hook', [HookController::class, 'cmd']);