Can we edit the content of the message we sent to Telegram earlier?
Sample;
‘Hello World’
editing
‘O world! how are you’
something like this was done but I couldn’t understand it.
<?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"];
// get message_id
$messageId = $update["message"]["message_id"];
switch($message) {
case("action"):
sendMessage($chatId, "What should I do?");
break;
case("add"):
// add the 2nd parameter
editMessageText($chatId, $messageId, "should I add?");
break;
default:
sendMessage($chatId, "default");
}
function sendMessage($chatId, $message) {