You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a continuation of this discussion.
As a refresher from the above, the discord.js GuildMember structure comes with a partial property whose definition states whether GuildMember#joinedTimestamp is null or not. When using this in a TypeScript project, the type definition for GuildMember#partial is strictly false. With that, one can infer from this that GuildMember#joinedTimestamp surely won't ever be null then, yet the typings for that property say otherwise. These typings contradict each other on whether GuildMember#joinedTimestamp is actually nullish or not.
Jiralite in the discussion linked above made mention that "Receiving a PRESENCE_UPDATE event on an uncached guild member has no joined_at field". What would prevent the further use of the PartialGuildMember type, which appropriately nullifies appropriate property types and informs the developer that the structure is a partial? Using this type where applicable would then negate the need to have nullish joinedTimestamp and joinedAt property value types for the GuildMember structure, which would then bring these aforementioned GuildMember property types into harmony.
Reproduce steps
1: Create new discord.js project with TypeScript
2: Import GuildMember and PartialGuildMember types
3: Observe property values partial, joinedAt, and joinedTimestamp on both types
Code sample
importtype{GuildMember,PartialGuildMember}from"discord.js";declareconstguildMember: GuildMember;declareconstpartialGuildMember: PartialGuildMember;guildMember.joinedTimestamp;// number | nullguildMember.partial;// falsepartialGuildMember.joinedTimestamp;// nullpartialGuildMember.partial;// true
Versions
discord.js v14.15.2
Node.js v18.17.0
Typescript v5.4.5
Windows 10 Home 22H2 19045.4412
Issue priority
Low (slightly annoying)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered:
Which package is this bug report for?
discord.js
Issue description
This is a continuation of this discussion.
As a refresher from the above, the discord.js GuildMember structure comes with a
partial
property whose definition states whether GuildMember#joinedTimestamp is null or not. When using this in a TypeScript project, the type definition for GuildMember#partial is strictly false. With that, one can infer from this that GuildMember#joinedTimestamp surely won't ever be null then, yet the typings for that property say otherwise. These typings contradict each other on whether GuildMember#joinedTimestamp is actually nullish or not.Jiralite in the discussion linked above made mention that "Receiving a
PRESENCE_UPDATE
event on an uncached guild member has nojoined_at
field". What would prevent the further use of the PartialGuildMember type, which appropriately nullifies appropriate property types and informs the developer that the structure is a partial? Using this type where applicable would then negate the need to have nullishjoinedTimestamp
andjoinedAt
property value types for the GuildMember structure, which would then bring these aforementioned GuildMember property types into harmony.Reproduce steps
1: Create new discord.js project with TypeScript
2: Import GuildMember and PartialGuildMember types
3: Observe property values
partial
,joinedAt
, andjoinedTimestamp
on both typesCode sample
Versions
Issue priority
Low (slightly annoying)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: