snowflake and cleaning up classes
This commit is contained in:
parent
14d1c69c7d
commit
7eb3ff6cab
21 changed files with 584 additions and 361 deletions
|
@ -1,5 +1,6 @@
|
|||
export { Role };
|
||||
import { Permissions } from "./permissions.js";
|
||||
import { SnowFlake } from "./snowflake.js";
|
||||
class Role {
|
||||
permissions;
|
||||
owner;
|
||||
|
@ -16,6 +17,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue