hennus-api
Version:
Esta es una libreria para el bot Hennus
46 lines (45 loc) • 1.25 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GuildRoles = void 0;
const data_1 = require("../base/data");
const bitfield_1 = require("../bitfield");
class GuildRoles extends data_1.BaseData {
constructor(data, client) {
super(client);
this.data = data;
Object.defineProperty(this, "data", {
value: data,
});
this.id = data.id;
this.name = data.name;
this.color = data.color || 0;
this.hoist = data.hoist;
this.position = Number(data.position);
this.permissions = new bitfield_1.PermissionsBitField(Number(data.permissions));
this.managed = data.managed;
this.mentionable = data.mentionable;
this.icon = data.icon ?? undefined;
}
iconURL(options) {
if (!this.icon)
return undefined;
return this.cdn.roleIcon(this.id, this.icon, options);
}
toJson() {
return this.data;
}
;
toString() {
if (this.id)
return `<@&${this.id}>`;
else
return "";
}
;
get hexColor() {
return `#${this.color.toString(16).padStart(6, '0')}`;
}
;
}
exports.GuildRoles = GuildRoles;
;