github/app/Services/TG/Hook/Base.php
2025-04-13 21:09:12 +08:00

54 lines
1.3 KiB
PHP

<?php
namespace App\Services\TG\Hook;
//use App\Services\TomTool\Http;
//use App\Models\Article as ModelArticle;
use App\Services\TomTool\Http;
use App\Services\TG\Http as TGHttp;
class Base {
public function __construct() {
$this->oHttp = new Http();
$this->oTGHttp = new TGHttp();
}
// protected function sendMessage($sText = '?') {
//
// if (env('is_loc') === true) {
// echo "<pre>";
// var_dump($sText);
// } else {
// $url = "https://api.telegram.org/bot$this->sApiToken/sendMessage?chat_id=$this->sApiChatId&text=" . urlencode($sText);
// file_get_contents($url);
// }
//
// }
protected function cmdGood($sCmd) {
$sCmdNew = "";
switch ($sCmd) {
case "user":
$sCmdNew = "user_name";
break;
case "project":
$sCmdNew = "project_name";
break;
case "code":
$sCmdNew = "sale_code";
break;
case "condition":
$sCmdNew = "cron_condition";
break;
default:
$sCmdNew = $sCmd;
break;
}
return $sCmdNew;
}
}