Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I edit the inline message, I get an error Invalid message content specified #3157

Open
jandyk088 opened this issue Dec 1, 2024 · 1 comment

Comments

@jandyk088
Copy link

The code is as follows
if( object instanceof UpdateNewInlineCallbackQuery query){
List 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

@levlam
Copy link
Contributor

levlam commented Dec 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants