some refactoring

This commit is contained in:
hdvtdev
2025-04-24 21:57:53 +03:00
parent 5fe53b2539
commit 97e93f7feb
2 changed files with 46 additions and 62 deletions

View File

@@ -19,6 +19,8 @@ public interface TelegramBot {
File awaitDownloadFile(TelegramFile telegramFile, Path targetDirectory);
void shutdown();
default CompletableFuture<File> downloadFile(TelegramFile telegramFile, Path targetDirectory) throws TelegramApiException, TelegramApiNetworkException {
return CompletableFuture.supplyAsync(() -> awaitDownloadFile(telegramFile, targetDirectory));
}