[Feature] Avatar decorations support (#2782)

* yup

* nullable...

* add props & methos to `GuildUser` & `IUser`
This commit is contained in:
Mihail Gribkov
2023-11-18 23:38:36 +03:00
committed by GitHub
parent b45b7743a5
commit f64d9d6f22
6 changed files with 90 additions and 0 deletions

View File

@@ -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";
}
}

View File

@@ -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();
}
}