fix id and snowflake
This commit is contained in:
parent
5e9405207b
commit
4f80104e2e
17 changed files with 263 additions and 235 deletions
|
@ -7,7 +7,7 @@ class Role{
|
|||
permissions:Permissions;
|
||||
owner:Guild;
|
||||
color:number;
|
||||
readonly id:SnowFlake<Role>;
|
||||
readonly snowflake:SnowFlake<Role>;
|
||||
name:string;
|
||||
info:Guild["info"];
|
||||
hoist:boolean;
|
||||
|
@ -15,12 +15,15 @@ class Role{
|
|||
mentionable:boolean;
|
||||
unicode_emoji:string;
|
||||
headers:Guild["headers"];
|
||||
get id(){
|
||||
return this.snowflake.id;
|
||||
}
|
||||
constructor(JSON, owner:Guild){
|
||||
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);
|
||||
this.snowflake=new SnowFlake(JSON.id,this);
|
||||
continue;
|
||||
}
|
||||
this[thing]=JSON[thing];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue