Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Extract GetDisplayAvatarUrl in IUser #2771

Merged

Conversation

zobweyt
Copy link
Contributor

@zobweyt zobweyt commented Aug 29, 2023

Description

This PR has a big effect on getting the user's avatar url and the need to create an extra extension or code duplication.

Here's how to get the display url of the user's avatar now, compared to the previous implementation:

- string url = user.GetAvatarUrl(format, size) ?? user.GetDefaultAvatarUrl();
+ string url = user.GetDisplayAvatarUrl(format, size);

Changes

  • Extract GetDisplayAvatarUrl in IUser and complete it in heirs. (e51ef51)
  • Fix webhook user's GetDisplayAvatarUrl implementation – now it will return the default avatar intead of null, which is quite obvious and corresponds to reality. (e51ef51)
  • Remove obsolete GetAvatarAsync example in IUser.Examples. (d4b491c)
  • Update avatar getters documentation for ease of reading. (6b5a7dc)

Related Issues

@quinchs quinchs enabled auto-merge (squash) November 18, 2023 20:46
@quinchs quinchs merged commit b1787d8 into discord-net:dev Nov 18, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants