TS conversion
This commit is contained in:
parent
75fa9d0844
commit
845c7f6612
44 changed files with 6225 additions and 611 deletions
28
.dist/role.js
Normal file
28
.dist/role.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
export { Role };
|
||||
import { Permissions } from "./permissions.js";
|
||||
class Role {
|
||||
permissions;
|
||||
owner;
|
||||
color;
|
||||
id;
|
||||
constructor(JSON, owner) {
|
||||
for (const thing of Object.keys(JSON)) {
|
||||
this[thing] = JSON[thing];
|
||||
}
|
||||
this.permissions = new Permissions(JSON.permissions);
|
||||
this.owner = owner;
|
||||
}
|
||||
get guild() {
|
||||
return this.owner;
|
||||
}
|
||||
get localuser() {
|
||||
return this.guild.localuser;
|
||||
}
|
||||
getColor() {
|
||||
if (this.color === 0) {
|
||||
return null;
|
||||
}
|
||||
;
|
||||
return `#${this.color.toString(16)}`;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue