我想创建一个电报机器人,我写了这个代码,我还设置了 Webhook,这个代码将电报机器人的 Json 响应返回给它自己,但我不知道为什么它不工作.. 任何帮助和指南都会受到赞赏。
$token = 'my token';
// read incoming info and grab the chatID
$json = file_get_contents('php://input');
$telegram = urldecode ($json);
$results = json_decode($telegram);
// send reply
$url = 'https://api.telegram.org/bot'.$token.'/sendMessage?chat_id=80853440&text='.$json;
file_get_contents($url);