Replies: 1 comment 1 reply
-
|
Receiving a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
All properties mentioned here may be assumed to be under an instance of the GuildMember class unless otherwise mentioned to help with readability.
In one of my TS projects,
joinedTimestampas well asjoinedAthave a type that is either a number or Date respectively, ornull. Why is that? I've looked on the Discord server, and every answer I saw regarding the reasoning for them being possibly null is because it's a partial GuildMember. With that knowledge, shouldn't the nullified values be strictly put inPartialGuildMemberinstead? The d.js typings for a PartialGuildMember havejoinedAt,joinedTimestamp, andpendingset to where they may be null already, so why is this nullish typing behavior extending into the full GuildMember structure?Furthermore, in the full GuildMember structure typings, the
partialgetter has an explicit type definition of false, which I believe most would infer means that the GuildMember that they're working with is a full GuildMember structure -joinedTimestampandjoinedAtnot being null. With that being said, the definition of this getter isreturn this.joinedTimestamp === null;, which solidifies that if<GuildMember>.joinedTimestampis null, then<GuildMember>.partialis true, and if it isn't null, thenpartialshould be false. If the type definition for thepartialgetter in a full GuildMember structure is explicitlyfalse, why isjoinedTimestampandjoinedAtstill being typed as if it can be null when thepartialtype definition says otherwise?Beta Was this translation helpful? Give feedback.
All reactions