utils: fix snowflakeToTimestamp using wrong epoch
This commit is contained in:
parent
4400d27c48
commit
ce7398c94a
1 changed files with 4 additions and 3 deletions
|
@ -404,9 +404,10 @@ function getUploadLimit(guild) {
|
|||
const TWITTER_EPOCH = 1288834974657;
|
||||
const DISCORD_EPOCH = 1420070400000;
|
||||
function snowflakeToTimestamp(snowflake, twitter = false) {
|
||||
return Math.floor(Number(snowflake) / Math.pow(2, 22)) + twitter
|
||||
? TWITTER_EPOCH
|
||||
: DISCORD_EPOCH;
|
||||
return (
|
||||
Math.floor(Number(snowflake) / Math.pow(2, 22)) +
|
||||
(twitter == true ? TWITTER_EPOCH : DISCORD_EPOCH)
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Reference in a new issue