aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/pinapelz/Retriever.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/pinapelz/Retriever.java')
-rw-r--r--src/main/java/com/pinapelz/Retriever.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/pinapelz/Retriever.java b/src/main/java/com/pinapelz/Retriever.java
index 856dab1..db314fe 100644
--- a/src/main/java/com/pinapelz/Retriever.java
+++ b/src/main/java/com/pinapelz/Retriever.java
@@ -13,6 +13,10 @@ public class Retriever {
}
public String getFileUrl(String channelId, String messageId, String fileName) {
+ return getFileUrl(channelId, messageId, fileName, false);
+ }
+
+ public String getFileUrl(String channelId, String messageId, String fileName, boolean isWebhookUpload) {
TextChannel channel = jda.getTextChannelById(channelId);
if (channel == null) {
throw new RuntimeException("Channel not found or deleted");
@@ -23,10 +27,10 @@ public class Retriever {
for (Message.Attachment file : message.getAttachments()) {
if (file.getFileName().equals(fileName)) {
- return file.getProxyUrl();
+ return isWebhookUpload ? file.getUrl() : file.getProxyUrl();
}
}
throw new RuntimeException("Matching attachment not found");
}
-} \ No newline at end of file
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage