mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
fix(Activity): ensure that timestamps are actually numbers
Fixes #2364 Discord sends those timestamps packed as SMALL_BIG_EXT, which get converted to strings in js. ~~Maybe they are already preparing their timestamps for 2038.~~
This commit is contained in:
@@ -108,8 +108,8 @@ class Activity {
|
||||
* @prop {?Date} end When the activity will end
|
||||
*/
|
||||
this.timestamps = data.timestamps ? {
|
||||
start: data.timestamps.start ? new Date(data.timestamps.start) : null,
|
||||
end: data.timestamps.end ? new Date(data.timestamps.end) : null,
|
||||
start: data.timestamps.start ? new Date(Number(data.timestamps.start)) : null,
|
||||
end: data.timestamps.end ? new Date(Number(data.timestamps.end)) : null,
|
||||
} : null;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user