mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(MessageEmbed): createdAt field can be zero (#7218)
This commit is contained in:
@@ -88,7 +88,8 @@ class MessageEmbed {
|
||||
* @type {?number}
|
||||
*/
|
||||
// Date.parse() cannot be used here because data.timestamp might be a number
|
||||
this.timestamp = 'timestamp' in data ? new Date(data.timestamp).getTime() : null;
|
||||
// Additionally, the nullish coalescing operator cannot be used here as we're checking for 0
|
||||
this.timestamp = new Date(data.timestamp).getTime() || null;
|
||||
|
||||
/**
|
||||
* Represents a field of a MessageEmbed
|
||||
|
||||
Reference in New Issue
Block a user