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

Document avatar decorations #5723

Merged
merged 2 commits into from Jul 13, 2023
Merged

Conversation

advaith1
Copy link
Contributor

@advaith1 advaith1 commented Dec 8, 2022

currently it checks the client version when deciding whether to return the avatar decoration hash, can that be fixed for bots and oauth2? (setting x-super-properties works as a workaround)

resolves #5690

@Victorsitou
Copy link
Contributor

Animated avatar decorations are not supported yet, right?

@advaith1
Copy link
Contributor Author

advaith1 commented Dec 8, 2022

some decorations are animated but they are returned as an animated png, you can't get them as a gif (like stickers)

their hashes start with a_

@@ -321,9 +321,10 @@ Discord uses ids and hashes to render images in the client. These hashes can be
| Default User Avatar | embed/avatars/[user_discriminator](#DOCS_RESOURCES_USER/user-object).png \*\* \*\*\* | PNG |
| User Avatar | avatars/[user_id](#DOCS_RESOURCES_USER/user-object)/[user_avatar](#DOCS_RESOURCES_USER/user-object).png \* | PNG, JPEG, WebP, GIF |
| Guild Member Avatar | guilds/[guild_id](#DOCS_RESOURCES_GUILD/guild-object)/users/[user_id](#DOCS_RESOURCES_USER/user-object)/avatars/[member_avatar](#DOCS_RESOURCES_GUILD/guild-member-object).png \* | PNG, JPEG, WebP, GIF |
| User Avatar Decoration | avatar-decorations/[user_id](#DOCS_RESOURCES_USER/user-object)/[user_avatar_decoration](#DOCS_RESOURCES_USER/user-object).png | PNG |
Copy link
Contributor

Choose a reason for hiding this comment

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

WebP and JPEG are also supported from the looks of it

Copy link
Contributor Author

@advaith1 advaith1 Dec 11, 2022

Choose a reason for hiding this comment

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

it responds with a png image (for animated ones at least)

Copy link
Contributor

Choose a reason for hiding this comment

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

Huh. Interesting.

| flags? | integer | the [flags](#DOCS_RESOURCES_USER/user-object-user-flags) on a user's account | identify |
| premium_type? | integer | the [type of Nitro subscription](#DOCS_RESOURCES_USER/user-object-premium-types) on a user's account | identify |
| public_flags? | integer | the public [flags](#DOCS_RESOURCES_USER/user-object-user-flags) on a user's account | identify |
| avatar_decoration? | ?string | the user's [avatar decoration hash](#DOCS_REFERENCE/image-formatting) | identify |
Copy link
Contributor

Choose a reason for hiding this comment

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

In what circumstances is this optional?

Copy link
Contributor

Choose a reason for hiding this comment

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

Partial data I think

Copy link
Contributor

Choose a reason for hiding this comment

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

In what circumstances is this optional?

I'd assume this is the same situation with banners where it's only returned via GW and /users. I'll check in a second

Copy link
Contributor

Choose a reason for hiding this comment

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

In what circumstances is this optional?

I'd assume this is the same situation with banners where it's only returned via GW and /users. I'll check in a second

From what I've seen, avatar_decoration seems to be always available, even on partial users.

Copy link
Contributor

Choose a reason for hiding this comment

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

That would seem to be the case yeah
image

Copy link
Contributor

Choose a reason for hiding this comment

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

The only user field that doesn't seem to have avatar_decoration is Widget.members
image

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense, I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's present on normal user objects but not on bare user objects like webhook message authors

@shaydewael shaydewael merged commit 3074b5f into discord:main Jul 13, 2023
2 checks passed
Nihlus added a commit to Remora/Remora.Discord that referenced this pull request Jul 14, 2023
HTGAzureX1212 pushed a commit to twilight-rs/twilight that referenced this pull request Jul 16, 2023
lukellmann pushed a commit to kordlib/kord that referenced this pull request Aug 3, 2023
shaydewael added a commit to Jupith/discord-api-docs that referenced this pull request May 14, 2024
Co-authored-by: shay <swdewael@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

avatar_decoration field in User object is undocumented
5 participants