remove snowflake instances
This commit is contained in:
parent
004beb4955
commit
e66b6c0883
16 changed files with 97 additions and 149 deletions
|
@ -4,7 +4,6 @@ import{ Message }from"./message.js";
|
|||
import{ Localuser }from"./localuser.js";
|
||||
import{User}from"./user.js";
|
||||
import{ Member }from"./member.js";
|
||||
import{ SnowFlake }from"./snowflake.js";
|
||||
import{ dirrectjson, memberjson }from"./jsontypes.js";
|
||||
import{ Permissions }from"./permissions.js";
|
||||
|
||||
|
@ -19,7 +18,6 @@ class Direct extends Guild{
|
|||
this.headers=this.localuser.headers;
|
||||
this.channels=[];
|
||||
this.channelids={};
|
||||
this.snowflake=new SnowFlake("@me");
|
||||
this.properties={};
|
||||
this.roles=[];
|
||||
this.roleids=new Map();
|
||||
|
@ -84,7 +82,7 @@ dmPermissions.setPermission("USE_VAD",1);
|
|||
class Group extends Channel{
|
||||
user:User;
|
||||
constructor(json:dirrectjson,owner:Direct){
|
||||
super(-1,owner);
|
||||
super(-1,owner,json.id);
|
||||
this.owner=owner;
|
||||
this.headers=this.guild.headers;
|
||||
this.name=json.recipients[0]?.username;
|
||||
|
@ -94,7 +92,6 @@ class Group extends Channel{
|
|||
this.user=this.localuser.user;
|
||||
}
|
||||
this.name??=this.localuser.user.username;
|
||||
this.snowflake=new SnowFlake(json.id);
|
||||
this.parent_id=null;
|
||||
this.parent=null;
|
||||
this.children=[];
|
||||
|
@ -106,7 +103,8 @@ class Group extends Channel{
|
|||
if(this.lastmessageid){
|
||||
this.position=Number((BigInt(this.lastmessageid)>>22n)+1420070400000n);
|
||||
}
|
||||
this.position=-Math.max(this.position,this.snowflake.getUnixTime());
|
||||
|
||||
this.position=-Math.max(this.position,this.getUnixTime());
|
||||
}
|
||||
createguildHTML(){
|
||||
const div=document.createElement("div");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue