When I edit the inline message, I get an error Invalid message content specified
The code is as follows if( object instanceof UpdateNewInlineCallbackQuery query){ List<TextEntity> textEntity = new ArrayList<>(); var tt = new InputMessagePhoto(); tt.photo = new InputFileLocal("Absolute file path"); tt.caption = new FormattedText("23232323", textEntity.toArray(new TextEntity[0])); var replyMarkup = new TdApi.ReplyMarkupInlineKeyboard();
var btn = new InlineKeyboardButton[1][1];
btn[0][0] = new InlineKeyboardButton();
btn[0][0].type = new InlineKeyboardButtonTypeCallback("123".getBytes());
btn[0][0].text = "botcall";
replyMarkup.rows = btn;
var func2 = new EditInlineMessageMedia(query.inlineMessageId, replyMarkup, tt);
client.send(func2, result2 -> {
System.out.println("result2: " + result2);
});
}
request print result2: Error { code = 400 message = "Invalid message content specified" }
1.The message to be edited was sent using "InputInlineQueryResultPhoto". 2.The image formats of original messages and edited messages are "png". 3.EditInlineMessageCaption or EditInlineMessageText can edit the same message normally. 4.The TDLIB version used is the latest version, and the git last updated on November 17, 2024 GMT+7 4:10:24 PM 5.The operating system is macos 15.1
You can't upload files while editing inline messages. See https://core.telegram.org/bots/api#editmessagemedia:
When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL.