From 8a839687cc76c0f4ed95e3f6b9f1f4d1729171d0 Mon Sep 17 00:00:00 2001 From: hellcat <> Date: Sun, 6 Jul 2025 14:20:57 +0800 Subject: [PATCH] no message --- src/Services/Tg/Http.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Services/Tg/Http.php b/src/Services/Tg/Http.php index a9051615..79207a59 100644 --- a/src/Services/Tg/Http.php +++ b/src/Services/Tg/Http.php @@ -2,6 +2,7 @@ namespace App\Services\Tg; use App\Models\Config; +use App\Services\IM\Telegram; class Http { @@ -10,19 +11,22 @@ 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) + public function sendToTG($sMsg = "没有msg?") { if ($_ENV['is_loc'] === true) { echo "
";
echo($sMsg);
} else {
- $url = "https://api.telegram.org/bot$this->sApiToken/sendMessage?chat_id=$this->sApiChatId&text=" . urlencode($sMsg);
- file_get_contents($url);
+
+ (new Telegram())->send(0, $sMsg);
+
+// $url = "https://api.telegram.org/bot$this->sApiToken/sendMessage?chat_id=$this->sApiChatId&text=" . urlencode($sMsg);
+// file_get_contents($url);
}
}