mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 09:42:22 +00: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:
parent
9f8925226d
commit
464fc14edd
1 changed files with 2 additions and 2 deletions
|
|
@ -108,8 +108,8 @@ class Activity {
|
||||||
* @prop {?Date} end When the activity will end
|
* @prop {?Date} end When the activity will end
|
||||||
*/
|
*/
|
||||||
this.timestamps = data.timestamps ? {
|
this.timestamps = data.timestamps ? {
|
||||||
start: data.timestamps.start ? new Date(data.timestamps.start) : null,
|
start: data.timestamps.start ? new Date(Number(data.timestamps.start)) : null,
|
||||||
end: data.timestamps.end ? new Date(data.timestamps.end) : null,
|
end: data.timestamps.end ? new Date(Number(data.timestamps.end)) : null,
|
||||||
} : null;
|
} : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue