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

Start username docs updates #6130

Closed
wants to merge 5 commits into from

Conversation

shaydewael
Copy link
Contributor

@shaydewael shaydewael commented May 4, 2023

Update docs based on the new username changes (outlined here for regular users and here for apps/bots)

docs/Reference.md Outdated Show resolved Hide resolved

The new username system will rollout to users over time rather than all at once. The value of a single zero (`"0"`) in the [`discriminator` field](#DOCS_RESOURCES_USER/user-object-user-structure) on a user will indicate that the user has been migrated to the new username system. Note that the discriminator for migrated users will *not* be 4-digits like a standard discriminator (it is `"0"`, not `"0000"`). The value of the `username` field will become the migrated user's unique username.

After migration of all users is complete, the `discriminator` field may be removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
After migration of all users is complete, the `discriminator` field may be removed.
After migration of all users is complete, the `discriminator` field may be removed in a future API version.

docs/Change_Log.md Outdated Show resolved Hide resolved
@@ -318,7 +318,7 @@ Discord uses ids and hashes to render images in the client. These hashes can be
| Guild Discovery Splash | discovery-splashes/[guild_id](#DOCS_RESOURCES_GUILD/guild-object)/[guild_discovery_splash](#DOCS_RESOURCES_GUILD/guild-object).png | PNG, JPEG, WebP |
| Guild Banner | banners/[guild_id](#DOCS_RESOURCES_GUILD/guild-object)/[guild_banner](#DOCS_RESOURCES_GUILD/guild-object).png \* | PNG, JPEG, WebP, GIF |
| User Banner | banners/[user_id](#DOCS_RESOURCES_USER/user-object)/[user_banner](#DOCS_RESOURCES_USER/user-object).png \* | PNG, JPEG, WebP, GIF |
| Default User Avatar | embed/avatars/[user_discriminator](#DOCS_RESOURCES_USER/user-object).png \*\* \*\*\* | PNG |
| Default User Avatar | embed/avatars/[user_id](#DOCS_RESOURCES_USER/user-object).png \*\* \*\*\* | PNG |
Copy link
Contributor

@Syjalo Syjalo May 4, 2023

Choose a reason for hiding this comment

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

Suggested change
| Default User Avatar | embed/avatars/[user_id](#DOCS_RESOURCES_USER/user-object).png \*\* \*\*\* | PNG |
| Default User Avatar | embed/avatars/[user_creation_timestamp](#DOCS_RESOURCES_USER/user-object).png \*\* \*\*\* | PNG |

user_id % 5 and (user >> 22) % 5 can not be the same

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not an API route, but CDN

Copy link
Contributor

Choose a reason for hiding this comment

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

user_id is correct
with user_discriminator the calculation was user_discriminator % 5 as well

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem here is that this is listed as user_id even though it is computed to be (user_id >> 22) % 5 but it is listed away as a note for some reason, and that reason is very likely "I couldn't find a better name for it." Just wish it was in here instead as at a glance it is inaccurate unless you read its disclaimer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair. Maybe a new section could be added for this docs part and be linked in this table like calculated_hash

And in the section the calculation method then.

AstreaTSS added a commit to AstreaTSS/interactions-py-library that referenced this pull request May 4, 2023
docs/Change_Log.md Outdated Show resolved Hide resolved
@@ -28,7 +28,8 @@ There are other rules and restrictions not shared here for the sake of spam and
| ------------- | --------- | ---------------------------------------------------------------------------------------------------- | --------------------- |
| id | snowflake | the user's id | identify |
| username | string | the user's username, not unique across the platform | identify |
| discriminator | string | the user's 4-digit discord-tag | identify |
| discriminator | string | the user's Discord-tag | identify |
| global_name | ?string | the user's display name, if it is set. For bots, this is the application name | identify |
Copy link
Contributor

@Syjalo Syjalo May 5, 2023

Choose a reason for hiding this comment

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

Is the property nullable just during the migration or an user may not has a global name even after the migration?

Copy link
Contributor

Choose a reason for hiding this comment

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

As part of the new username system, standard Discord users can define a non-unique display name. This value will be a new global_name field with a max length of 32 characters. If the user has not set a display name, global_name will be null.

As part of the new username system, standard Discord users can define a non-unique display name. This value will be a new `global_name` field with a max length of 32 characters. If the user has not set a display name, `global_name` will be null.

@@ -28,7 +28,8 @@ There are other rules and restrictions not shared here for the sake of spam and
| ------------- | --------- | ---------------------------------------------------------------------------------------------------- | --------------------- |
| id | snowflake | the user's id | identify |
| username | string | the user's username, not unique across the platform | identify |
| discriminator | string | the user's 4-digit discord-tag | identify |
| discriminator | string | the user's Discord-tag | identify |
| global_name | ?string | the user's display name, if it is set. For bots, this is the application name | identify |
Copy link
Contributor

@lukellmann lukellmann May 5, 2023

Choose a reason for hiding this comment

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

Suggested change
| global_name | ?string | the user's display name, if it is set. For bots, this is the application name | identify |
| global_name? | ?string | the user's display name, if it is set. For bots, this is the application name | identify |

this seems to be missing in the author field of the message returned when executing a webhook with wait=true

lukellmann added a commit to kordlib/kord that referenced this pull request May 5, 2023
LordOfPolls pushed a commit to interactions-py/interactions.py that referenced this pull request May 5, 2023
* fix: correct typehint for discrim

* fix💥: account for discord's discrim change

* fix: match behavior to discord docs pr

discord/discord-api-docs#6130

* feat: set default for discrim

---------

Co-authored-by: Astrea49 <25420078+Astrea49@users.noreply.github.com>
@Doc94
Copy link
Contributor

Doc94 commented May 16, 2023

looks like they add a new field called display_name not?

@advaith1
Copy link
Contributor

display_name is deprecated, it was replaced with global_name

shaydewael and others added 3 commits May 17, 2023 15:24
Co-authored-by: Florian Spieß <business@minn.dev>
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
Co-authored-by: Suspense <64612795+AlmostSuspense@users.noreply.github.com>
@@ -28,7 +28,8 @@ There are other rules and restrictions not shared here for the sake of spam and
| ------------- | --------- | ---------------------------------------------------------------------------------------------------- | --------------------- |
| id | snowflake | the user's id | identify |
| username | string | the user's username, not unique across the platform | identify |

Choose a reason for hiding this comment

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

Suggested change
| username | string | the user's username, not unique across the platform | identify |
| username | string | the user's username, unique across the platform | identify |

It should now be unique?

@@ -318,7 +318,7 @@ Discord uses ids and hashes to render images in the client. These hashes can be
| Guild Discovery Splash | discovery-splashes/[guild_id](#DOCS_RESOURCES_GUILD/guild-object)/[guild_discovery_splash](#DOCS_RESOURCES_GUILD/guild-object).png | PNG, JPEG, WebP |
| Guild Banner | banners/[guild_id](#DOCS_RESOURCES_GUILD/guild-object)/[guild_banner](#DOCS_RESOURCES_GUILD/guild-object).png \* | PNG, JPEG, WebP, GIF |
| User Banner | banners/[user_id](#DOCS_RESOURCES_USER/user-object)/[user_banner](#DOCS_RESOURCES_USER/user-object).png \* | PNG, JPEG, WebP, GIF |
| Default User Avatar | embed/avatars/[user_discriminator](#DOCS_RESOURCES_USER/user-object).png \*\* \*\*\* | PNG |
| Default User Avatar | embed/avatars/[user_id](#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.

i'd just call it index, and then have instructions below for how to calculate it.

@A5rocks
Copy link
Contributor

A5rocks commented May 22, 2023

Hi, is the default avatar changing for all users or just those with this new username system? This PR seems to contradict itself on this and I didn't get a response in DDevs :(

@Lulalaby
Copy link
Contributor

Lulalaby commented May 22, 2023

Hi, is the default avatar changing for all users or just those with this new username system? This PR seems to contradict itself on this and I didn't get a response in DDevs :(

for the ones with the new username.
if you try the way for ones with discrim, the generated avatar differs from the one in the client.

so if user has discrim: discrim % 5
if user has new username: (id >> 22) % 6

Comment on lines +3 to +5
#### May 3, 2023

## Unique usernames on Discord
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### May 3, 2023
## Unique usernames on Discord
## Unique usernames on Discord
#### May 3, 2023

Fix formatting in accordance with #6162.

@ImRodry
Copy link
Contributor

ImRodry commented Jun 4, 2023

Will the display_name property also be documented? Seems to do the same as global_name, idk why it's there

@advaith1
Copy link
Contributor

advaith1 commented Jun 4, 2023

display_name was renamed to global_name, ignore the old one

@FasterSpeeding
Copy link
Contributor

has this PR been abandoned?

@shaydewael shaydewael marked this pull request as ready for review June 7, 2023 16:41
@shaydewael shaydewael closed this Jun 7, 2023
@shaydewael shaydewael mentioned this pull request Jun 7, 2023
@shaydewael
Copy link
Contributor Author

moved to #6218 because of some weird syncing issues

@RGBCube
Copy link

RGBCube commented Jun 9, 2023

Hi, is the default avatar changing for all users or just those with this new username system? This PR seems to contradict itself on this and I didn't get a response in DDevs :(

for the ones with the new username.
if you try the way for ones with discrim, the generated avatar differs from the one in the client.

so if user has discrim: discrim % 5
if user has new username: (id >> 22) % 5

Now it is (id >> 22) % 6 because of the new pink default profile picture

@Lulalaby
Copy link
Contributor

Lulalaby commented Jun 9, 2023

Updated my comment 👌

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.