summary refs log tree commit diff
path: root/dist/server-util/src/util/Permissions.js
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 00:30:07 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 00:30:07 +0100
commit8e84d39c7f2531e81eed3a9d01bf4030b19a2c88 (patch)
treeeb89f194780f903388cf968e9073cab4aed75ccc /dist/server-util/src/util/Permissions.js
parent:art: Channel + Member + Message + Role in separate collection (diff)
downloadserver-8e84d39c7f2531e81eed3a9d01bf4030b19a2c88.tar.xz
:sparkles: getPermission util function
Diffstat (limited to 'dist/server-util/src/util/Permissions.js')
-rw-r--r--dist/server-util/src/util/Permissions.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/dist/server-util/src/util/Permissions.js b/dist/server-util/src/util/Permissions.js
deleted file mode 100644

index 596e1fa9..00000000 --- a/dist/server-util/src/util/Permissions.js +++ /dev/null
@@ -1,55 +0,0 @@ -"use strict"; -// https://github.com/discordjs/discord.js/blob/master/src/util/Permissions.js -// Apache License Version 2.0 Copyright 2015 - 2021 Amish Shah -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Permissions = void 0; -const BitField_1 = require("./BitField"); -class Permissions extends BitField_1.BitField { - any(permission, checkAdmin = true) { - return (checkAdmin && super.has(Permissions.FLAGS.ADMINISTRATOR)) || super.any(permission); - } - /** - * Checks whether the bitfield has a permission, or multiple permissions. - * @param {PermissionResolvable} permission Permission(s) to check for - * @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override - * @returns {boolean} - */ - has(permission, checkAdmin = true) { - return (checkAdmin && super.has(Permissions.FLAGS.ADMINISTRATOR)) || super.has(permission); - } -} -exports.Permissions = Permissions; -Permissions.FLAGS = { - CREATE_INSTANT_INVITE: 1n << 0n, - KICK_MEMBERS: 1n << 1n, - BAN_MEMBERS: 1n << 2n, - ADMINISTRATOR: 1n << 3n, - MANAGE_CHANNELS: 1n << 4n, - MANAGE_GUILD: 1n << 5n, - ADD_REACTIONS: 1n << 6n, - VIEW_AUDIT_LOG: 1n << 7n, - PRIORITY_SPEAKER: 1n << 8n, - STREAM: 1n << 9n, - VIEW_CHANNEL: 1n << 10n, - SEND_MESSAGES: 1n << 11n, - SEND_TTS_MESSAGES: 1n << 12n, - MANAGE_MESSAGES: 1n << 13n, - EMBED_LINKS: 1n << 14n, - ATTACH_FILES: 1n << 15n, - READ_MESSAGE_HISTORY: 1n << 16n, - MENTION_EVERYONE: 1n << 17n, - USE_EXTERNAL_EMOJIS: 1n << 18n, - VIEW_GUILD_INSIGHTS: 1n << 19n, - CONNECT: 1n << 20n, - SPEAK: 1n << 21n, - MUTE_MEMBERS: 1n << 22n, - DEAFEN_MEMBERS: 1n << 23n, - MOVE_MEMBERS: 1n << 24n, - USE_VAD: 1n << 25n, - CHANGE_NICKNAME: 1n << 26n, - MANAGE_NICKNAMES: 1n << 27n, - MANAGE_ROLES: 1n << 28n, - MANAGE_WEBHOOKS: 1n << 29n, - MANAGE_EMOJIS: 1n << 30n, -}; -//# sourceMappingURL=Permissions.js.map \ No newline at end of file