Replies: 1 comment 1 reply
{{title}}
Something went wrong.
{{editor}}'s edit
{{actor}} deleted this content
.
{{editor}}'s edit
Something went wrong.
-
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
{{title}}
-
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,
joinedTimestamp
as well asjoinedAt
have 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 inPartialGuildMember
instead? The d.js typings for a PartialGuildMember havejoinedAt
,joinedTimestamp
, andpending
set 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
partial
getter 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 -joinedTimestamp
andjoinedAt
not being null. With that being said, the definition of this getter isreturn this.joinedTimestamp === null;
, which solidifies that if<GuildMember>.joinedTimestamp
is null, then<GuildMember>.partial
is true, and if it isn't null, thenpartial
should be false. If the type definition for thepartial
getter in a full GuildMember structure is explicitlyfalse
, why isjoinedTimestamp
andjoinedAt
still being typed as if it can be null when thepartial
type definition says otherwise?Beta Was this translation helpful? Give feedback.
All reactions