no message

This commit is contained in:
hellcat 2025-07-10 16:58:10 +08:00
parent b8c9bc0be8
commit a369047941

View File

@ -3,6 +3,7 @@
namespace App\Services\Tg;
use App\Models\Config;
use App\Services\IM\Telegram;
use App\Services\Tg\Http;
class Http {
@ -11,8 +12,8 @@ class Http {
function __construct()
{
// $this->sApiToken = Config::obtain('telegram_token');
// $this->sApiChatId = Config::obtain('telegram_chatid');
$this->sApiToken = Config::obtain('telegram_token');
$this->sApiChatId = Config::obtain('telegram_chatid');
}
public function sendToTG($sMsg = "没有msg", $aUpdate = [])
@ -28,7 +29,23 @@ class Http {
} else {
(new Telegram())->send(0, $sMsg);
$oHttp = new Http();
$oHttp->sMethod = "post";
$oHttp->sToUrl = "https://api.telegram.org/bot$this->sApiToken/sendMessage";
// $oHttp->bIsJson = true;
$oHttp->aData = [
"chat_id" => $this->sApiChatId,
"text" => $sMsg
];
$oHttp->send();
// (new Telegram())->send(0, $sMsg);
}