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

[Feature] Support for the new username system #2696

Merged
merged 9 commits into from
Jun 27, 2023

Conversation

Misha-133
Copy link
Member

@Misha-133 Misha-133 commented Jun 7, 2023

This PR brings support for the new username system introduced by discord.

Changes

  • update all ToString() methods of user entities & their debugger display properties to use the new unique username instead of username#discriminator pattern if discriminator value is equals to 0 - the placeholder value.
  • made discriminator parameter of BaseSocketClient.GetUser() method optional
  • update EmbedBuilderExtensions.WithAuthor()
  • update MentionUtils
  • Add GlobalName property to user entities
  • Add a new CDN method with support for new default avatar calculation
  • Update UserTypeReader in Discord.Commands to search for GlobalName

Misc

P.S. I think I've found all places that need to be updated for the new system, pls correct me if I missed any

Co-authored-by: Dmitry <dimson-n@users.noreply.github.com>
@Panthr75
Copy link
Contributor

Might want to deprecate Discriminator and DiscriminatorValue, as most users have already transferred over to the new username system

@d4n3436
Copy link
Contributor

d4n3436 commented Jun 13, 2023

Might want to deprecate Discriminator and DiscriminatorValue, as most users have already transferred over to the new username system

Bots will remain on the old username system
https://support-dev.discord.com/hc/en-us/articles/13667755828631#h_01H26BDRT8ASH1YVKG6HMGZ1J2

src/Discord.Net.Core/Entities/Users/IUser.cs Outdated Show resolved Hide resolved
src/Discord.Net.Core/Entities/Users/IUser.cs Outdated Show resolved Hide resolved
src/Discord.Net.Core/Format.cs Outdated Show resolved Hide resolved
src/Discord.Net.Core/Format.cs Outdated Show resolved Hide resolved
Misha-133 and others added 2 commits June 17, 2023 23:08
Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
Copy link
Contributor

@Panthr75 Panthr75 left a comment

Choose a reason for hiding this comment

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

Update SocketThreadUser.DisplayName to match SocketGuildUser.DisplayName by including a nullability check with GlobalName before Username

@quinchs quinchs merged commit df717e6 into discord-net:dev Jun 27, 2023
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.

[Bug]: New usernames are displayed with #0000 discriminator
5 participants