title: Using edit message in a telegram bot
body: <p>I'm trying to edit messages in a telegram bot.
  I'm using the following code. I can send messages with no problem, but the edit message part doesn't work. It just doesn't do anything!!</p>
  
  <pre><code>   &lt;?php
  
  if ($_SERVER['HTTPS'] != "on") {
  $url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
  header("Location: $url");
  exit;
  }
  
  $botToken="XXXX...";
  $website="https://api.telegram.org/bot".$botToken;
  
  $content = file_get_contents("php://input");
  $update = json_decode($content, true);
  $chatId = $update["message"]["chat"]["id"];
  $message = $update["message"]["text"];
  
  switch($message) {
      case("action"):
                  sendMessage($chatId, "What should I do?");
      break;
  
      case("add"):
          editMessageText($chatId, "should I add?");
  
      break;
  
  default:
      sendMessage($chatId, "default");
  }
  
  function sendMessage($chatId, $message) {
  
  $url = $GLOBALS[website]."/sendMessage?    chat_id=".$chatId."&amp;text=".urlencode($message)."&amp;reply_markup".$reply1;
  file_get_contents($url);
  }
  
  function editMessageText($chatId, $messageId, $message) {
  
  $url = $GLOBALS[website]."/editMessageText?chat_id=".$chatId."&amp;message_id=".$messageId."&amp;text=".urlencode($message);
  file_get_contents($url);
  
  }
  
  function file_get_contents_curl($url) {
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);       
  
  $data = curl_exec($ch);
  curl_close($ch);
  
  return $data;
  }
  
  
  ?&gt;
  </code></pre>
  
  <p>Any idea about what can be wrong with it?
  Thanks</p>