Skip to content

Commit

Permalink
file_get_contents
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNadeev committed Mar 27, 2024
1 parent c64eb5e commit a3fec1b
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,26 @@
// echo "Что-то пошло не так при отправке письма 🙁";
// }

$consts = file('consts.txt');

$apiToken = $consts[0];
$owner = $consts[1];
$dev = $consts[2];

function sendTelegram($chat_id, $message, $apiToken) {
$data = [
'chat_id' => $chat_id,
'text' => $message,
'parse_mode' => 'HTML'
];
echo $chat_id.$message.$apiToken;
$response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?".http_build_query($data));
}

sendTelegram($dev, $message, $apiToken);
$consts = file_get_contents('consts.txt');

// $apiToken = $consts[0];
// $owner = $consts[1];
// $dev = $consts[2];

// echo "1: ".$chat_id.$message.$apiToken;

echo "1: ".$consts;

// function sendTelegram($chat_id, $message, $apiToken) {
// $data = [
// 'chat_id' => $chat_id,
// 'text' => $message,
// 'parse_mode' => 'HTML'
// ];
// echo "2: ".$chat_id.$message.$apiToken;
// $response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?".http_build_query($data));
// }

// sendTelegram($dev, $message, $apiToken);

?>

0 comments on commit a3fec1b

Please sign in to comment.