[Refactor] Extract GetDisplayAvatarUrl in IUser (#2771)

* Implement `GetDisplayAvatarUrl` method

* Remove obsolete example

* Update XML documentation

---------

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This commit is contained in:
zobweyt
2023-11-18 23:50:17 +03:00
committed by GitHub
parent ac274d4b76
commit b1787d8334
10 changed files with 48 additions and 69 deletions

View File

@@ -142,6 +142,9 @@ namespace Discord.Rest
? CDN.GetDefaultUserAvatarUrl(DiscriminatorValue)
: CDN.GetDefaultUserAvatarUrl(Id);
public virtual string GetDisplayAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128)
=> GetAvatarUrl(format, size) ?? GetDefaultAvatarUrl();
/// <inheritdoc />
public string GetAvatarDecorationUrl()
=> AvatarDecorationHash is not null