From 00487d7a6ead80fe986cf03ad8eb5b9eddea8239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Spie=C3=9F?= Date: Sun, 22 Sep 2024 16:04:25 +0200 Subject: [PATCH] Expand check for isVoiceMessage --- src/main/java/net/dv8tion/jda/api/utils/FileUpload.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/dv8tion/jda/api/utils/FileUpload.java b/src/main/java/net/dv8tion/jda/api/utils/FileUpload.java index 6ac2f7b5d1..ecd713b27a 100644 --- a/src/main/java/net/dv8tion/jda/api/utils/FileUpload.java +++ b/src/main/java/net/dv8tion/jda/api/utils/FileUpload.java @@ -422,7 +422,10 @@ public FileUpload asVoiceMessage(@Nonnull MediaType mediaType, @Nonnull byte[] w */ public boolean isVoiceMessage() { - return this.mediaType.type().equals("audio"); + return this.mediaType.type().equals("audio") + && this.durationSeconds > 0.0 + && this.waveform != null + && this.waveform.length > 0; } /**