[Feature] Avatar decorations support (#2782)
* yup * nullable... * add props & methos to `GuildUser` & `IUser`
This commit is contained in:
@@ -257,5 +257,15 @@ namespace Discord
|
||||
_ => throw new ArgumentException(nameof(format)),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an avatar decoration url based off the hash.
|
||||
/// </summary>
|
||||
/// <param name="avatarDecorationHash">The hash of the avatar decoraition.</param>
|
||||
/// <returns>
|
||||
/// A URL to the avatar decoration.
|
||||
/// </returns>
|
||||
public static string GetAvatarDecorationUrl(string avatarDecorationHash)
|
||||
=> $"{DiscordConfig.CDNUrl}avatar-decoration-presets/{avatarDecorationHash}.png";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,22 @@ namespace Discord
|
||||
/// </remarks>
|
||||
string GlobalName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash of the avatar decoration.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see langword="null"/> if the user has no avatar decoration set.
|
||||
/// </remarks>
|
||||
string AvatarDecorationHash { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the id of the avatar decoration's SKU.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see langword="null"/> if the user has no avatar decoration set.
|
||||
/// </remarks>
|
||||
ulong? AvatarDecorationSkuId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates the direct message channel of this user.
|
||||
/// </summary>
|
||||
@@ -120,5 +136,14 @@ namespace Discord
|
||||
/// contains the DM channel associated with this user.
|
||||
/// </returns>
|
||||
Task<IDMChannel> CreateDMChannelAsync(RequestOptions options = null);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the URL for user's avatar decoration.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see langword="null"/> if the user has no avatar decoration set.
|
||||
/// </remarks>
|
||||
string GetAvatarDecorationUrl();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user