mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 05:52:05 +00:00
Added defaults to ServerPermissions
This commit is contained in:
parent
6a18740927
commit
76888151a2
2 changed files with 16 additions and 15 deletions
|
|
@ -5,7 +5,7 @@ var _createClass = (function () { function defineProperties(target, props) { for
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
var ServerPermissions = (function () {
|
var ServerPermissions = (function () {
|
||||||
function ServerPermissions(data) {
|
function ServerPermissions(data, server) {
|
||||||
_classCallCheck(this, ServerPermissions);
|
_classCallCheck(this, ServerPermissions);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
@ -14,13 +14,14 @@ var ServerPermissions = (function () {
|
||||||
return (self.packed >>> x & 1) === 1;
|
return (self.packed >>> x & 1) === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.managed = data.managed;
|
this.managed = data.managed || false;
|
||||||
this.position = data.position || 1;
|
this.position = data.position || 1;
|
||||||
this.hoist = data.hoist;
|
this.hoist = data.hoist || false;
|
||||||
this.color = data.color;
|
this.color = data.color || 0;
|
||||||
this.packed = data.permissions;
|
this.packed = data.permissions || 36953089;
|
||||||
this.name = data.name;
|
this.name = data.name || "new role";
|
||||||
this.id = data.id;
|
this.id = data.id || null;
|
||||||
|
this.server = server;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerPermissions.prototype.serialise = function serialise() {
|
ServerPermissions.prototype.serialise = function serialise() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
class ServerPermissions {
|
class ServerPermissions {
|
||||||
|
|
||||||
constructor(data) {
|
constructor(data, server) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
@ -8,14 +8,14 @@ class ServerPermissions {
|
||||||
return ((self.packed >>> x) & 1) === 1;
|
return ((self.packed >>> x) & 1) === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.managed = data.managed;
|
this.managed = data.managed || false;
|
||||||
this.position = data.position || 1;
|
this.position = data.position || 1;
|
||||||
this.hoist = data.hoist;
|
this.hoist = data.hoist || false;
|
||||||
this.color = data.color;
|
this.color = data.color || 0;
|
||||||
this.packed = data.permissions;
|
this.packed = data.permissions || 36953089;
|
||||||
this.name = data.name;
|
this.name = data.name || "new role";
|
||||||
this.id = data.id;
|
this.id = data.id || null;
|
||||||
|
this.server = server;
|
||||||
}
|
}
|
||||||
|
|
||||||
serialise() {
|
serialise() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue