Untitled

 avatar
unknown
plain_text
3 years ago
503 B
7
Indexable
<?php
ini_set ('display_errors', true);
$content = file_get_contents("php://input");

$update = json_decode($content,true);

$chat_id = $update["message"]['chat']['id'];
$text = $update["message"]['text'];

$url = 'https://api.telegram.org/bot5724544375:AAHZaxveJswoa48N3nELNuo2XHclJx4TsTY/sendMessage?chat_id=' . $chat_id . '&text=' . $text;
// CURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); # for return $url results
$result = curl_exec($ch);
Editor is loading...