Skip to content

Conversation

@advaith1
Copy link
Contributor

The current code examples do not select the correct avatar color

avatarSrc = `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`;
} else {
const defaultAvatarIndex = Math.abs(Number(user.id) >> 22) % 6;
const defaultAvatarIndex = (BigInt(user.id) >> 22n) % 6n;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ooo lol yeah that makes way more sense. Great catch. We'll want to update this in the sdk example as well.

Copy link
Contributor Author

@advaith1 advaith1 Apr 22, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor

@matthova matthova left a comment

Choose a reason for hiding this comment

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

Thanks for the patch 🫡
We've updated in the sdk examples as well discord/embedded-app-sdk#151

@shaydewael shaydewael merged commit b1449c3 into discord:main Apr 30, 2024
shaydewael pushed a commit to Jupith/discord-api-docs that referenced this pull request May 14, 2024
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.

3 participants