diff --git a/src/main/java/net/dv8tion/jda/api/entities/Guild.java b/src/main/java/net/dv8tion/jda/api/entities/Guild.java index ab1507e23a..0842bbeabb 100644 --- a/src/main/java/net/dv8tion/jda/api/entities/Guild.java +++ b/src/main/java/net/dv8tion/jda/api/entities/Guild.java @@ -75,7 +75,7 @@ public interface Guild extends ISnowflake /** Template for {@link #getSplashUrl()}. */ String SPLASH_URL = "https://cdn.discordapp.com/splashes/%s/%s.png"; /** Template for {@link #getBannerUrl()}. */ - String BANNER_URL = "https://cdn.discordapp.com/banners/%s/%s.png"; + String BANNER_URL = "https://cdn.discordapp.com/banners/%s/%s.%s"; /** * Retrieves the list of guild commands. @@ -844,7 +844,7 @@ default String getVanityUrl() default String getBannerUrl() { String bannerId = getBannerId(); - return bannerId == null ? null : String.format(BANNER_URL, getId(), bannerId); + return bannerId == null ? null : String.format(BANNER_URL, getId(), bannerId, bannerId.startsWith("a_") ? "gif" : "png"); } /** diff --git a/src/main/java/net/dv8tion/jda/api/events/guild/update/GuildUpdateBannerEvent.java b/src/main/java/net/dv8tion/jda/api/events/guild/update/GuildUpdateBannerEvent.java index 9318280f80..073d5ecb07 100644 --- a/src/main/java/net/dv8tion/jda/api/events/guild/update/GuildUpdateBannerEvent.java +++ b/src/main/java/net/dv8tion/jda/api/events/guild/update/GuildUpdateBannerEvent.java @@ -60,7 +60,7 @@ public String getNewBannerId() @Nullable public String getNewBannerUrl() { - return next == null ? null : String.format(Guild.BANNER_URL, guild.getId(), next); + return next == null ? null : String.format(Guild.BANNER_URL, guild.getId(), next, next.startsWith("a_") ? "gif" : "png"); } /** @@ -99,6 +99,6 @@ public String getOldBannerId() @Nullable public String getOldBannerUrl() { - return previous == null ? null : String.format(Guild.BANNER_URL, guild.getId(), previous); + return previous == null ? null : String.format(Guild.BANNER_URL, guild.getId(), previous, previous.startsWith("a_") ? "gif" : "png"); } }