Skip to main content

Class CDN

Represents a class containing the strings related to various Content Delivery Networks (CDNs).

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public static class CDN

Methods​

GetTeamIconUrl(UInt64, String)​

Returns a team icon URL.

View Source​
Declaration
public static string GetTeamIconUrl(ulong teamId, string iconId)
Returns​

System.String: A URL pointing to the team's icon.

Parameters​
TypeNameDescription
System.UInt64teamIdThe team identifier.
System.StringiconIdThe icon identifier.

GetApplicationIconUrl(UInt64, String)​

Returns an application icon URL.

View Source​
Declaration
public static string GetApplicationIconUrl(ulong appId, string iconId)
Returns​

System.String: A URL pointing to the application's icon.

Parameters​
TypeNameDescription
System.UInt64appIdThe application identifier.
System.StringiconIdThe icon identifier.

GetUserAvatarUrl(UInt64, String, UInt16, ImageFormat)​

Returns a user avatar URL.

View Source​
Declaration
public static string GetUserAvatarUrl(ulong userId, string avatarId, ushort size, ImageFormat format)
Returns​

System.String: A URL pointing to the user's avatar in the specified size.

Parameters​
TypeNameDescription
System.UInt64userIdThe user snowflake identifier.
System.StringavatarIdThe avatar identifier.
System.UInt16sizeThe size of the image to return in horizontal pixels. This can be any power of two between 16 and 2048.
Discord.ImageFormatformatThe format to return.

GetGuildUserAvatarUrl(UInt64, UInt64, String, UInt16, ImageFormat)​

View Source​
Declaration
public static string GetGuildUserAvatarUrl(ulong userId, ulong guildId, string avatarId, ushort size, ImageFormat format)
Returns​

System.String

Parameters​
TypeName
System.UInt64userId
System.UInt64guildId
System.StringavatarId
System.UInt16size
Discord.ImageFormatformat

GetUserBannerUrl(UInt64, String, UInt16, ImageFormat)​

Returns a user banner URL.

View Source​
Declaration
public static string GetUserBannerUrl(ulong userId, string bannerId, ushort size, ImageFormat format)
Returns​

System.String: A URL pointing to the user's banner in the specified size.

Parameters​
TypeNameDescription
System.UInt64userIdThe user snowflake identifier.
System.StringbannerIdThe banner identifier.
System.UInt16sizeThe size of the image to return in horizontal pixels. This can be any power of two between 16 and 2048.
Discord.ImageFormatformatThe format to return.

GetDefaultUserAvatarUrl(UInt16)​

Returns the default user avatar URL.

View Source​
Declaration
public static string GetDefaultUserAvatarUrl(ushort discriminator)
Returns​

System.String: A URL pointing to the user's default avatar when one isn't set.

Parameters​
TypeNameDescription
System.UInt16discriminatorThe discriminator value of a user.

GetGuildIconUrl(UInt64, String)​

Returns an icon URL.

View Source​
Declaration
public static string GetGuildIconUrl(ulong guildId, string iconId)
Returns​

System.String: A URL pointing to the guild's icon.

Parameters​
TypeNameDescription
System.UInt64guildIdThe guild snowflake identifier.
System.StringiconIdThe icon identifier.

GetGuildRoleIconUrl(UInt64, String)​

Returns a guild role's icon URL.

View Source​
Declaration
public static string GetGuildRoleIconUrl(ulong roleId, string roleHash)
Returns​

System.String: A URL pointing to the guild role's icon.

Parameters​
TypeNameDescription
System.UInt64roleIdThe role identifier.
System.StringroleHashThe icon hash.

GetGuildSplashUrl(UInt64, String)​

Returns a guild splash URL.

View Source​
Declaration
public static string GetGuildSplashUrl(ulong guildId, string splashId)
Returns​

System.String: A URL pointing to the guild's splash.

Parameters​
TypeNameDescription
System.UInt64guildIdThe guild snowflake identifier.
System.StringsplashIdThe splash icon identifier.

GetGuildDiscoverySplashUrl(UInt64, String)​

Returns a guild discovery splash URL.

View Source​
Declaration
public static string GetGuildDiscoverySplashUrl(ulong guildId, string discoverySplashId)
Returns​

System.String: A URL pointing to the guild's discovery splash.

Parameters​
TypeNameDescription
System.UInt64guildIdThe guild snowflake identifier.
System.StringdiscoverySplashIdThe discovery splash icon identifier.

GetChannelIconUrl(UInt64, String)​

Returns a channel icon URL.

View Source​
Declaration
public static string GetChannelIconUrl(ulong channelId, string iconId)
Returns​

System.String: A URL pointing to the channel's icon.

Parameters​
TypeNameDescription
System.UInt64channelIdThe channel snowflake identifier.
System.StringiconIdThe icon identifier.

GetGuildBannerUrl(UInt64, String, ImageFormat, Nullable<UInt16>)​

Returns a guild banner URL.

View Source​
Declaration
public static string GetGuildBannerUrl(ulong guildId, string bannerId, ImageFormat format, ushort? size = null)
Returns​

System.String: A URL pointing to the guild's banner image.

Parameters​
TypeNameDescription
System.UInt64guildIdThe guild snowflake identifier.
System.StringbannerIdThe banner image identifier.
Discord.ImageFormatformatThe format to return.
System.Nullable<System.UInt16>sizeThe size of the image to return in horizontal pixels. This can be any power of two between 16 and 2048 inclusive.

GetEmojiUrl(UInt64, Boolean)​

Returns an emoji URL.

View Source​
Declaration
public static string GetEmojiUrl(ulong emojiId, bool animated)
Returns​

System.String: A URL pointing to the custom emote.

Parameters​
TypeNameDescription
System.UInt64emojiIdThe emoji snowflake identifier.
System.BooleananimatedWhether this emoji is animated.

GetRichAssetUrl(UInt64, String, UInt16, ImageFormat)​

Returns a Rich Presence asset URL.

View Source​
Declaration
public static string GetRichAssetUrl(ulong appId, string assetId, ushort size, ImageFormat format)
Returns​

System.String: A URL pointing to the asset image in the specified size.

Parameters​
TypeNameDescription
System.UInt64appIdThe application identifier.
System.StringassetIdThe asset identifier.
System.UInt16sizeThe size of the image to return in. This can be any power of two between 16 and 2048.
Discord.ImageFormatformatThe format to return.

GetSpotifyAlbumArtUrl(String)​

Returns a Spotify album URL.

View Source​
Declaration
public static string GetSpotifyAlbumArtUrl(string albumArtId)
Returns​

System.String: A URL pointing to the Spotify album art.

Parameters​
TypeNameDescription
System.StringalbumArtIdThe identifier for the album art (e.g. 6be8f4c8614ecf4f1dd3ebba8d8692d8ce4951ac).

GetSpotifyDirectUrl(String)​

Returns a Spotify direct URL for a track.

View Source​
Declaration
public static string GetSpotifyDirectUrl(string trackId)
Returns​

System.String: A URL pointing to the Spotify track.

Parameters​
TypeNameDescription
System.StringtrackIdThe identifier for the track (e.g. 4uLU6hMCjMI75M1A2tKUQC).

GetStickerUrl(UInt64, StickerFormatType)​

Gets a stickers url based off the id and format.

View Source​
Declaration
public static string GetStickerUrl(ulong stickerId, StickerFormatType format = StickerFormatType.Png)
Returns​

System.String: A URL to the sticker.

Parameters​
TypeNameDescription
System.UInt64stickerIdThe id of the sticker.
Discord.StickerFormatTypeformatThe format of the sticker.