Don't force avatar formats
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
{
|
||||
public static string GetApplicationIconUrl(ulong appId, string iconId)
|
||||
=> iconId != null ? $"{DiscordConfig.CDNUrl}app-icons/{appId}/{iconId}.jpg" : null;
|
||||
public static string GetUserAvatarUrl(ulong userId, string avatarId, ushort size)
|
||||
=> avatarId != null ? $"{DiscordConfig.CDNUrl}avatars/{userId}/{avatarId}.webp?size={size}" : null;
|
||||
public static string GetUserAvatarUrl(ulong userId, string avatarId, ushort size, AvatarFormat format)
|
||||
=> avatarId != null ? $"{DiscordConfig.CDNUrl}avatars/{userId}/{avatarId}.{format.ToString().ToLower()}?size={size}" : null;
|
||||
public static string GetGuildIconUrl(ulong guildId, string iconId)
|
||||
=> iconId != null ? $"{DiscordConfig.CDNUrl}icons/{guildId}/{iconId}.jpg" : null;
|
||||
public static string GetGuildSplashUrl(ulong guildId, string splashId)
|
||||
|
||||
10
src/Discord.Net.Core/Entities/Users/AvatarFormat.cs
Normal file
10
src/Discord.Net.Core/Entities/Users/AvatarFormat.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Discord
|
||||
{
|
||||
public enum AvatarFormat
|
||||
{
|
||||
WebP,
|
||||
Png,
|
||||
Jpeg,
|
||||
Gif,
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace Discord
|
||||
/// <summary> Gets the id of this user's avatar. </summary>
|
||||
string AvatarId { get; }
|
||||
/// <summary> Gets the url to this user's avatar. </summary>
|
||||
string GetAvatarUrl(ushort size = 1024);
|
||||
string GetAvatarUrl(AvatarFormat format = AvatarFormat.Png, ushort size = 128);
|
||||
/// <summary> Gets the per-username unique id for this user. </summary>
|
||||
string Discriminator { get; }
|
||||
/// <summary> Gets the per-username unique id for this user. </summary>
|
||||
|
||||
Reference in New Issue
Block a user