discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.46k stars 3.97k forks source link

User#avatarDecoration property is always null. #10203

Closed BannerBomb closed 5 months ago

BannerBomb commented 7 months ago

Which package is this bug report for?

discord.js

Issue description

image As you can see my profile has that clown decoration. But User#avatarDecoration is showing null. https://github.com/discordjs/discord.js/blob/ba6476d07e3325dea573f16b8b957244b69bb05c/packages/discord.js/src/structures/User.js#L131 Looking at the raw data from the gateway. There is no "avatar_decoration" property. Only a "avatar_decoration_data" property. Which is an object of "sku_id" and "asset" properties.

Code sample

No response

Versions

v14.14.1

Issue priority

Low (slightly annoying)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildModeration, GuildEmojisAndStickers, GuildPresences, GuildMessages, GuildMessageReactions, GuildMessageTyping, DirectMessages, DirectMessageReactions, DirectMessageTyping, MessageContent

I have tested this issue on a development release

No response

BannerBomb commented 7 months ago

Edited the title, as I found another issue about the "banner" being null, but found it isn't null when using client.users.fetch('ID', { force: true })

monbrey commented 7 months ago

The avatar_decoration_data issue may be a valid bug - thank you for reporting.

The banner being null is expected - Discord does not include this data in the user object send with events, and it must be explicitly fetched to retrieve it. This is documented.

image

BannerBomb commented 7 months ago

The avatar_decoration_data issue may be a valid bug - thank you for reporting.

The banner being null is expected - Discord does not include this data in the user object send with events, and it must be explicitly fetched to retrieve it. This is documented.

image

yeah, I realized the banner one needed to be force fetched after making the report. Which is why I removed it from the post. I could make a pr for fixing the avatarDecoration. But I don't know how y'all would want to handle the object that is provided by the API.

Jiralite commented 7 months ago

The avatar_decoration_data issue may be a valid bug - thank you for reporting.

Unfortunately not: Discord renamed the property from avatar_decoration to avatar_decoration_data (https://github.com/discord/discord-api-docs/pull/6464). Therefore, it being always null is correct behaviour.

Since Discord has not merged the change of documentation, there is nothing (yet) to do.

I could make a pr for fixing the avatarDecoration. But I don't know how y'all would want to handle the object that is provided by the API.

9888 exists as a draft for when Discord is ready to document the change, but as said above, there's nothing that can be done otherwise.