diff --git a/app/Http/Controllers/Api/GithubController.php b/app/Http/Controllers/Api/GithubController.php index 717184cf..e24e95db 100755 --- a/app/Http/Controllers/Api/GithubController.php +++ b/app/Http/Controllers/Api/GithubController.php @@ -13,6 +13,7 @@ use App\Models\BoxCountry as ModelCountry; use Illuminate\Http\Request; use App\Models\BladeJctj as ModelBladeJctj; use App\Models\BladeJctjOption as ModelBladeJctjOption; +//use App\Services\Country as ServiceCountry; class GithubController { diff --git a/app/Services/Country-meiyong.php b/app/Services/Country-meiyong.php new file mode 100644 index 00000000..db41ffac --- /dev/null +++ b/app/Services/Country-meiyong.php @@ -0,0 +1,68 @@ +toArray(); + + shuffle($aCountry); + + $i = 1; + $aRandCountry = []; + foreach ($aCountry as $aCountryRow) { + + if (in_array($aCountryRow["name"], $aRandCountry)) { + continue; + } + + $aRandCountry[] = $aCountryRow["name"]; + + if ($i >= $iCountryLimit) { + break; + } else { + $i++; + } + + } + + $aData["country"] = $aRandCountry; + $aData["nodeCount"] = $iNodeCount; + $aData["speed"] = $iSpeed; +// $aData["str"] = "本次更新共".$iNodeLimit."个可用节点,"; + + return $aData; +// +// echo json_encode($aData); +// exit; + } + + public function strGithub($randData) + { + $str = date('Y年m月d日').",本次更新共".$randData["nodeCount"]."个可用节点,最高速度".$randData["speed"]."M/S。覆盖".implode("、", $randData["country"])."等多个区域。"; + + return $str; + } + +} diff --git a/app/Services/TG/Hook/Mod/DDT.php b/app/Services/TG/Hook/Mod/DDT.php index c9bc452b..0a6dc40c 100644 --- a/app/Services/TG/Hook/Mod/DDT.php +++ b/app/Services/TG/Hook/Mod/DDT.php @@ -204,7 +204,9 @@ class DDT extends Base { public function meEdit($aParam) { - $sValue = $aParam["aArg"][1] ?? false; + $aValue = $aParam["aArg"] ?? false; + + $sValue = implode(" ", $sValue); if ($sValue == "?") { return "/meEdit {value}";