-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
PASTUSEDBY/discord.js
#1Description
Please describe the problem you are having in as much detail as possible:
I am trying to avoid saving a nickname if it is not set, but the typings incorrectly claim string | null when it is actually string | undefined.
Include a reproducible code sample here, if possible:
const nickname = member.nickname;
if (nickname !== null) {
console.log(memTag, 'Saving name:', nickname);
setUserName(member.user.id, member.guild.id, nickname);
}This code will log "Saving name: undefined" when someone has no nickname, rather than not logging a message at all.
Further details:
- discord.js version: 12.2.0
- Node.js version: 14.1.0
- Operating system: Linux
- Priority this issue should have – please be realistic and elaborate if possible: High priority, causes unexpected bugs due to undeclared branch possibilities that the compiler cannot know
- I have also tested the issue on latest master, commit hash: f9f3661
Metadata
Metadata
Assignees
Labels
No labels