I have been trying to build a bot that asks the user to fill in the blank. Upon receive the user's response, the bot would edit the question message and fill in the blank with the user's answer. However, Telegram keeps throwing back "[400] Bad Request: message can't be edited"
I have checked the message_id which was the one bot has sent, and it was sent recently. I also tried a very simple version that it is supposed to send a message and edit it 10 seconds later. But it still threw back that error.
Here is the core part of that code. The message is sent successfully, but won't be edited.
try {
int edit_message_id = execute(message).getMessageId();
// the method above is always executed successfully
sleep(10000);
EditMessageText editMessageText = new EditMessageText()
.setChatId(user_id)
.setMessageId(edit_message_id)
.setText("I'm trying!!!");
execute(editMessageText);
} catch (TelegramApiException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
which throws back,
Error editing message text: [400] Bad Request: message can't be edited
I appreciate your help!