mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +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
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue