use more generic function for time conversions
This commit is contained in:
@@ -3,6 +3,7 @@ import { Channel } from "./channel.js";
|
||||
import { Message } from "./message.js";
|
||||
import { User } from "./user.js";
|
||||
import { Permissions } from "./permissions.js";
|
||||
import { SnowFlake } from "./snowflake.js";
|
||||
class Direct extends Guild {
|
||||
constructor(json, owner) {
|
||||
super(-1, owner, null);
|
||||
@@ -95,7 +96,7 @@ class Group extends Channel {
|
||||
this.mentions = 0;
|
||||
this.setUpInfiniteScroller();
|
||||
if (this.lastmessageid) {
|
||||
this.position = Number((BigInt(this.lastmessageid) >> 22n) + 1420070400000n);
|
||||
this.position = SnowFlake.stringToUnixTime(this.lastmessageid);
|
||||
}
|
||||
this.position = -Math.max(this.position, this.getUnixTime());
|
||||
}
|
||||
|
Reference in New Issue
Block a user