Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Executor;
Expand Down Expand Up @@ -230,6 +231,18 @@ private <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequ
return response;
}

try {
Thread.sleep(Duration.ofSeconds(15));

response = bot.execute(request);

if (response.isOk()) {
return response;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}

throw new TelegramApiException(request.getMethod(), response.description());
}

Expand Down
Loading