diff --git a/app/Services/TG/Hook/Base.php b/app/Services/TG/Hook/Base.php index 259e25f..d8534b3 100644 --- a/app/Services/TG/Hook/Base.php +++ b/app/Services/TG/Hook/Base.php @@ -11,6 +11,8 @@ class Base { public function __construct() { $this->oHttp = new Http(); $this->oTGHttp = new TGHttp(); + $this->oTGHttp->sApiToken = env("telegram_token"); + $this->oTGHttp->sApiChatId = env("telegram_chatid"); } // protected function sendMessage($sText = '?') { diff --git a/app/Services/TG/Http.php b/app/Services/TG/Http.php index f92674d..741d974 100644 --- a/app/Services/TG/Http.php +++ b/app/Services/TG/Http.php @@ -14,7 +14,7 @@ class Http { echo "
";
var_dump($sMsg);
} else {
- $url = "https://api.telegram.org/bot$this->sApiToken/sendMessage?chat_id=$this->sApiChatId&text=" . urlencode($sText);
+ $url = "https://api.telegram.org/bot$this->sApiToken/sendMessage?chat_id=$this->sApiChatId&text=" . urlencode($sMsg);
file_get_contents($url);
}