diff --git a/sender.php b/sender.php index b5629ce..6905b76 100644 --- a/sender.php +++ b/sender.php @@ -43,21 +43,21 @@ $conststxt = file_get_contents('consts.txt'); $consts = explode("\n", $conststxt); -$apiToken = substr($consts[0], 0, -1); -$owner = substr($consts[1], 0, -1); -$dev = substr($consts[2], 0, -1); +$apiToken = $consts[0]; +$owner = $consts[1]; +$dev = $consts[2]; echo "0: "."a"."b"; echo "1: ".$owner.$dev.$apiToken; function sendTelegram($chat_id, $message, $apiToken) { $data = [ - 'chat_id' => $chat_id, - 'text' => $message, + 'chat_id' => substr($chat_id, 0, -1), + 'text' => substr($message, 0, -1), 'parse_mode' => 'HTML' ]; echo "2: ".$chat_id.$message.$apiToken; - $response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?".http_build_query($data)); + $response = file_get_contents("https://api.telegram.org/bot"substr($apiToken, 0, -1)"/sendMessage?".http_build_query($data)); }; sendTelegram($dev, $message, $apiToken);