I'm messing around with writing a own bot for telegramm using hook.io to host the php script. The problem that I have is that file_get_contents("php://input") always seems to be empty, since the bot does not react if I try to do anything related to the update:
$updates = json_decode(file_get_contents('php://input') ,true);
if($updates['ok']){
//loop over all messages
foreach($updates['result'] as $key => $value){
if($value['message']['text']==="/test"){
$chat_id = $value['message']['chat']['id'];
$result = file_get_contents( $apiURL . $apiToken . '/sendMessage?chat_id=' . $chat_id . '&text=test');
}
}
}
Can anyone tell whats wrong with this one?