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

Fix nickname change #320

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Fix nickname change #320

merged 1 commit into from
Nov 14, 2024

Conversation

zuuring
Copy link
Member

@zuuring zuuring commented Nov 14, 2024

Notes

Change member.user.username to member.displayName to resolve username replacing the nickname in the event the initial member.nickname isn't grabbed.

Remove excess logging on each server nicknames.

### Notes

Change `member.user.username` to `member.displayName` to resolve username replacing the nickname in the event the initial member.nickname isn't grabbed.

Remove excess logging on each server nicknames.
@@ -84,7 +80,7 @@ export default async function webhookDiscord(
if (!userId) throw new Error("User not found with the specified name")

const member = await guild.members.fetch(userId)
const currentNickname = member.nickname || member.user.username
const currentNickname = member.nickname ?? member.displayName
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this then fall back one more time on the username, or does display name handle that? What's the difference between display name and nickname? It feels like that might be backwards (display name being server specific and nick being global maybe?).

Copy link
Member Author

@zuuring zuuring Nov 14, 2024

Choose a reason for hiding this comment

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

The nice part about member.displayName (doc link) is it will load Guild nickname again and then if a nickname isn't set, default to username.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we only use that in that case?

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Approving as this is good enough to ship, but let's wrap up that discussion below.

@Shadowfiend Shadowfiend merged commit 57c6fad into main Nov 14, 2024
7 checks passed
@Shadowfiend Shadowfiend deleted the fix-nickname-change branch November 14, 2024 16:36
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.

2 participants