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

Update in accordance with discord changes #1135

Closed
wants to merge 3 commits into from
Closed

Update in accordance with discord changes #1135

wants to merge 3 commits into from

Conversation

WissemBad
Copy link

@WissemBad WissemBad commented Dec 29, 2023

The DisplayName, introduced this year by Discord, can now be found alongside the Username and Discriminator.

You'll find all the information about the fields currently being returned on the Discord Developer Portal - Users Resource.

New returned fields :

  • id : The user's id (snowflake).
  • nickname : The user's name with discriminator (name#0000).
  • username : The user's username (name).
  • discriminator : The user's Discord-tag (0000).
  • global_name : The user's display name, if it is set (Amazing Name).
  • email : The user's email ([email protected]).
  • avatar : The user's avatar URL.

WissemBad and others added 3 commits December 29, 2023 14:08
The nickname is back with the old syntax.
The nickname is back with the old syntax.
@@ -115,11 +115,13 @@ protected function formatAvatar(array $user)
protected function mapUserToObject(array $user)
{
return (new User())->setRaw($user)->map([
'id' => $user['id'],
'nickname' => $user['username'].($user['discriminator'] !== '0' ? '#'.$user['discriminator'] : ''),
'name' => $user['username'],
Copy link
Member

Choose a reason for hiding this comment

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

Removing the name field here would be a breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

Happy to dd the username field in addition, but they can always use getRaw to get the other fields.

@atymic
Copy link
Member

atymic commented Jan 26, 2024

ping @WissemBad
Will close this if no update in next few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants