Suggest me an idea, please
Closed this issue · 2 comments
NewbieProger commented
I want to use bot as resender
So, I have RestApi app which has an endpoint where I can send POST method
Which type of annotioan I should use to read attachments which I send to my bot which will send each attachment via Rest to my app?
kshashov commented
You can get the file url from the message and then download it in any convenient way
@BotRequest(value = "**", type = {MessageType.MESSAGE})
public String printFileUrl(Message message, TelegramBot bot) {
GetFileResponse getFile = bot.execute(new GetFile(message.document().fileId()));
String url = bot.getFullFilePath(getFile.file());
// TODO download and process the file
return url;
}
NewbieProger commented
Thanks a lot!