remove snowflake instances

This commit is contained in:
MathMan05
2024-09-03 11:00:44 -05:00
parent 004beb4955
commit e66b6c0883
16 changed files with 97 additions and 149 deletions

View File

@@ -4,11 +4,10 @@ import{Localuser}from"./localuser.js";
import{Guild}from"./guild.js";
import{ SnowFlake }from"./snowflake.js";
import{ rolesjson }from"./jsontypes.js";
class Role{
class Role extends SnowFlake{
permissions:Permissions;
owner:Guild;
color:number;
readonly snowflake:SnowFlake;
name:string;
info:Guild["info"];
hoist:boolean;
@@ -16,15 +15,12 @@ class Role{
mentionable:boolean;
unicode_emoji:string;
headers:Guild["headers"];
get id(){
return this.snowflake.id;
}
constructor(json:rolesjson, owner:Guild){
super(json.id);
this.headers=owner.headers;
this.info=owner.info;
for(const thing of Object.keys(json)){
if(thing==="id"){
this.snowflake=new SnowFlake(json.id);
continue;
}
this[thing]=json[thing];