mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
ServerRoleCreate listener
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var Permissions = require("../Constants.js").Permissions;
|
||||
@@ -23,7 +21,7 @@ var DefaultRole = [Permissions.createInstantInvite, Permissions.readMessages, Pe
|
||||
}, 0);
|
||||
|
||||
var Role = (function () {
|
||||
function Role(data, serverID, client) {
|
||||
function Role(data, server, client) {
|
||||
_classCallCheck(this, Role);
|
||||
|
||||
this.position = data.position || -1;
|
||||
@@ -33,7 +31,7 @@ var Role = (function () {
|
||||
this.id = data.id;
|
||||
this.hoist = data.hoist || false;
|
||||
this.color = data.color || 0;
|
||||
this.serverID = serverID;
|
||||
this.server = server;
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
@@ -135,13 +133,6 @@ var Role = (function () {
|
||||
return "#" + val;
|
||||
};
|
||||
|
||||
_createClass(Role, [{
|
||||
key: "server",
|
||||
get: function get() {
|
||||
return this.client.internal.servers.get("id", this.serverID);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Role;
|
||||
})();
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ var Server = (function (_Equality) {
|
||||
});
|
||||
|
||||
data.roles.forEach(function (dataRole) {
|
||||
_this.roles.add(new Role(dataRole, _this));
|
||||
_this.roles.add(new Role(dataRole, _this, client));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user