From 0590095f3a355d416e5e41e5f66928d1901b6137 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Tue, 4 Jun 2019 20:48:06 -0700 Subject: [PATCH] add method for getting vanity image from CDN --- src/Discord.Net.Core/CDN.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Discord.Net.Core/CDN.cs b/src/Discord.Net.Core/CDN.cs index 0fefc9a0d..cd9db24a6 100644 --- a/src/Discord.Net.Core/CDN.cs +++ b/src/Discord.Net.Core/CDN.cs @@ -76,6 +76,18 @@ namespace Discord /// public static string GetChannelIconUrl(ulong channelId, string iconId) => iconId != null ? $"{DiscordConfig.CDNUrl}channel-icons/{channelId}/{iconId}.jpg" : null; + + /// + /// Returns a guild vanity URL. + /// + /// The guild snowflake identifier. + /// The vanity image identifier. + /// The size of the image to return in. This can be any power of two between 16 and 2048. + /// + /// A URL pointing to the guild's vanity image. + /// + public static string GetGuildVanityUrl(ulong guildId, string vanityId, ushort size) + => vanityId != null ? $"{DiscordConfig.CDNUrl}banners/{guildId}/{vanityId}.jpg?size={size}" : null; /// /// Returns an emoji URL. ///