From cd91a384bd7150910d0c0342fc9313151563ed48 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Sat, 3 Oct 2015 21:10:43 +0100 Subject: [PATCH] added getBit to channelpermissions --- src/ChannelPermissions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ChannelPermissions.js b/src/ChannelPermissions.js index 83b562f71..13f183867 100644 --- a/src/ChannelPermissions.js +++ b/src/ChannelPermissions.js @@ -1,6 +1,10 @@ class ChannelPermissions{ constructor(data){ + function getBit(x) { + return ((this.packed >>> x) & 1) === 1; + } + this.type = data.type; //either member or role this.id = data.id; @@ -10,6 +14,10 @@ class ChannelPermissions{ this.allow = data.allow; } + + getBit(x) { + return ((this.packed >>> x) & 1) === 1; + } } module.exports = ChannelPermissions; \ No newline at end of file