snowflake and cleaning up classes

This commit is contained in:
MathMan05 2024-07-23 23:01:45 -05:00
parent 14d1c69c7d
commit 7eb3ff6cab
21 changed files with 584 additions and 361 deletions

View file

@ -2,11 +2,12 @@ export {Role};
import {Permissions} from "./permissions.js";
import {Localuser} from "./localuser.js";
import {Guild} from "./guild.js";
import { SnowFlake } from "./snowflake.js";
class Role{
permissions:Permissions;
owner:Guild;
color:number;
id:string;
readonly id:SnowFlake<Role>;
name:string;
info:Guild["info"];
hoist:boolean;
@ -18,6 +19,10 @@ class Role{
this.headers=owner.headers;
this.info=owner.info;
for(const thing of Object.keys(JSON)){
if(thing==="id"){
this.id=new SnowFlake(JSON.id,this);
continue;
}
this[thing]=JSON[thing];
}
this.permissions=new Permissions(JSON.permissions);