Answer the question
In order to leave comments, you need to log in
How to send a file link for downloading on the telegram side in telegram java api?
Download link from google drive, tried it with a link to download the VK file - the same thing
If I download the file on my server and send a telegram, then everything is ok
SendDocument sendDocument = new SendDocument();
String urlDownload = task.getSolution();
sendDocument.setChatId(idChat);
sendDocument.setDocument(downloadFile(urlDownload, task.getFileName()));
String urlDownload = task.getSolution();
sendDocument.setChatId(idChat);
sendDocument.setDocument(new InputFile().setMedia(urlDownload));
new InputMediaPhoto().setMedia(urlCoverBook);
Answer the question
In order to leave comments, you need to log in
In my case, the error usually popped up when I tried to send a file/message without the execute() method. It's worth trying to send a file like this:
execute(sendDocument(nameOfFile, new InputFile(url + fomatFile));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question