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

Add Guild Member avatar #1077

Merged
merged 4 commits into from
Feb 25, 2022
Merged

Conversation

andresperezl
Copy link
Contributor

@andresperezl andresperezl commented Jan 22, 2022

Fixes #965

This PR adds support for the Guild-specific member avatar, if any.

To follow the same pattern as *User.AvatarURL, also add the same method for *Member.AvatarURL , and create an util method avatarURL to handle both.

Also, set the *Member.GuildID after the GuildMember requests, as this is not included with the returned object.

I have tested these changes with my own bot

@andresperezl
Copy link
Contributor Author

I see this is a duplicate of #985, but the original author seems to be inactive after being asked for some changes

w.r.t #985 (comment)

I saw other string fields which are also nullable to be left as simple string (like Nick) so I followed the same, but I can change it to *string if that is what is desired.

cc @FedorLap2006 @CarsonHoffman

Copy link
Collaborator

@FedorLap2006 FedorLap2006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me. But it might require a couple of changes.

structs.go Outdated Show resolved Hide resolved
@FedorLap2006
Copy link
Collaborator

FedorLap2006 commented Jan 31, 2022

Tip: you can resolve conversations when they're outdated or finished. Anyways, thank you for the PR. 👍

@FedorLap2006
Copy link
Collaborator

It's ready to be merged, but please note the conflict.

* add avatar field on Member struct

* add endpoints for guild avatars

* add avatarURL util function for *User.AvatarURL and *Member.AvatarURL

* set GuildID on after GuildMember request
@andresperezl
Copy link
Contributor Author

@FedorLap2006 I have rebased my changes with latest master

structs.go Outdated Show resolved Hide resolved
@FedorLap2006
Copy link
Collaborator

Thanks for the contribution!

@FedorLap2006 FedorLap2006 merged commit dd5b9c6 into bwmarrin:master Feb 25, 2022
@andresperezl andresperezl deleted the guild_member_avatar branch February 25, 2022 21:28
@FedorLap2006 FedorLap2006 added this to the v0.24.0 milestone Feb 27, 2022
@FedorLap2006 FedorLap2006 added the feature Major feature implementation label Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Major feature implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for per-guild avatars.
2 participants