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
feat: Add Guild Member Cover & Accent Color support #1117
feat: Add Guild Member Cover & Accent Color support #1117
Conversation
Tested manually : works with static and animated user banner. @FedorLap2006 Ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall PR looks good to me, except a couple of things. Additionally, I see inconsistent naming of cover
and banner
. Please fix that.
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
user.go
Outdated
// size: The size of the desired banner image as a power of two | ||
// Image size can be any power of two between 16 and 4096. | ||
func (u *User) BannerURL(size string) string { | ||
// The default/empty avatar case should be handled by the above condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this belongs to Member.BannerURL
structs.go
Outdated
// BannerURL returns the URL of the member's banner image. | ||
// size: The size of the desired banner image as a power of two | ||
// Image size can be any power of two between 16 and 4096. | ||
func (m *Member) BannerURL(size string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this would be necessary, since Member
doesn't have Banner
property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not actually implemented on Discord API v9 but custom banner per server is actually a feature of the Discord client (Available on Edit Server Profile
). In Discord Client app, the app fallback to the user banner if the field banner
of Member is null.
I just added the fallback strategy now and wait the banner field to be released
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to just implement it when it goes out. DiscordGo is 1:1 mapping, so if API doesn't have it, we don't as well.
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
I'll give it a look tomorrow |
Thank you for your contribution! Due to the fact that v0.24.0 is planned for today, I decided to make a couple of changes which I proposed to the PR myself. I think that would be best to open a new PR and implement |
I will add Guild Member Cover & Accent Color support to the library
Resolve #1093