mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
rebuilt files
This commit is contained in:
@@ -1,22 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var Permissions = require("../Constants.js").Permissions;
|
||||
|
||||
var ChannelPermissions = (function () {
|
||||
function ChannelPermissions(permissions) {
|
||||
_classCallCheck(this, ChannelPermissions);
|
||||
|
||||
class ChannelPermissions {
|
||||
constructor(permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
ChannelPermissions.prototype.serialise = function serialise(explicit) {
|
||||
var _this = this;
|
||||
serialise(explicit) {
|
||||
|
||||
var hp = function hp(perm) {
|
||||
return _this.hasPermission(perm, explicit);
|
||||
};
|
||||
var hp = perm => this.hasPermission(perm, explicit);
|
||||
|
||||
return {
|
||||
// general
|
||||
@@ -43,16 +36,14 @@ var ChannelPermissions = (function () {
|
||||
voiceMoveMembers: hp(Permissions.voiceMoveMembers),
|
||||
voiceUseVAD: hp(Permissions.voiceUseVAD)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
ChannelPermissions.prototype.serialize = function serialize() {
|
||||
serialize() {
|
||||
// ;n;
|
||||
return this.serialise();
|
||||
};
|
||||
|
||||
ChannelPermissions.prototype.hasPermission = function hasPermission(perm) {
|
||||
var explicit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
|
||||
}
|
||||
|
||||
hasPermission(perm, explicit = false) {
|
||||
if (perm instanceof String || typeof perm === "string") {
|
||||
perm = Permissions[perm];
|
||||
}
|
||||
@@ -67,9 +58,7 @@ var ChannelPermissions = (function () {
|
||||
}
|
||||
}
|
||||
return !!(this.permissions & perm);
|
||||
};
|
||||
|
||||
return ChannelPermissions;
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ChannelPermissions;
|
||||
Reference in New Issue
Block a user