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

Add FileProxy#withClient overrides #2698

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/main/java/net/dv8tion/jda/api/utils/AttachmentProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.dv8tion.jda.internal.utils.Checks;
import net.dv8tion.jda.internal.utils.FutureUtil;
import net.dv8tion.jda.internal.utils.IOUtil;
import okhttp3.OkHttpClient;

import javax.annotation.Nonnull;
import java.io.File;
Expand Down Expand Up @@ -50,6 +51,13 @@ public AttachmentProxy(@Nonnull String url)
super(url);
}

@Nonnull
@Override
public AttachmentProxy withClient(@Nonnull OkHttpClient customHttpClient)
{
return (AttachmentProxy) super.withClient(customHttpClient);
}

/**
* Returns the attachment URL for the specified width and height.
* <br>The width and height is a best-effort resize from Discord.
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/net/dv8tion/jda/api/utils/ImageProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.dv8tion.jda.internal.utils.Checks;
import net.dv8tion.jda.internal.utils.FutureUtil;
import net.dv8tion.jda.internal.utils.IOUtil;
import okhttp3.OkHttpClient;

import javax.annotation.Nonnull;
import java.io.File;
Expand Down Expand Up @@ -47,6 +48,13 @@ public ImageProxy(@Nonnull String url)
super(url);
}

@Nonnull
@Override
public ImageProxy withClient(@Nonnull OkHttpClient customHttpClient)
{
return (ImageProxy) super.withClient(customHttpClient);
}

/**
* Returns the image URL for the specified size.
* <br>The size is a best-effort resize from Discord, with recommended size values as powers of 2 such as 1024 or 512.
Expand Down
Loading