设置webhook ...
我想向机器人用户发送消息,以响应来自他们的任何消息 和
我真的想用cURL
$content = file_get_contents("php://input");
$update = json_decode($content, true);
$chat_id = $update['message']['chat']['id'];
echo $chat_id;
$ch = curl_init();
$url = "https://api.telegram.org/bot" . bot_token . "/";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "sendMessage?chat_id=" . $chat_id . "&text=hello");
$res = curl_exec($ch);
curl_close($ch);