From 2859daeba89e56683c60d99db0d6100fa4ac797d Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 14 Feb 2021 20:24:39 +0100 Subject: [PATCH] :bug: fix permission --- dist/util/Permissions.d.ts | 2 +- dist/util/Permissions.js | 2 +- dist/util/Permissions.js.map | 2 +- src/util/Permissions.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/util/Permissions.d.ts b/dist/util/Permissions.d.ts index ad7d6a36..3c9dd24b 100644 --- a/dist/util/Permissions.d.ts +++ b/dist/util/Permissions.d.ts @@ -57,5 +57,5 @@ export declare class Permissions extends BitField { }; }): bigint; } -export declare function getPermission(user_id: bigint, guild_id: bigint, channel_id?: bigint): Promise; +export declare function getPermission(user_id: bigint, guild_id: bigint, channel_id?: bigint): Promise; export {}; diff --git a/dist/util/Permissions.js b/dist/util/Permissions.js index b3176221..44525eee 100644 --- a/dist/util/Permissions.js +++ b/dist/util/Permissions.js @@ -105,7 +105,7 @@ async function getPermission(user_id, guild_id, channel_id) { overwrites: channel?.permission_overwrites, }, }); - return permission; + return new Permissions(permission); } exports.getPermission = getPermission; //# sourceMappingURL=Permissions.js.map \ No newline at end of file diff --git a/dist/util/Permissions.js.map b/dist/util/Permissions.js.map index b46968d5..8b945d9e 100644 --- a/dist/util/Permissions.js.map +++ b/dist/util/Permissions.js.map @@ -1 +1 @@ -{"version":3,"file":"Permissions.js","sourceRoot":"","sources":["../../src/util/Permissions.ts"],"names":[],"mappings":";;;AAAA,8EAA8E;AAC9E,8DAA8D;AAC9D,6CAA+C;AAC/C,+CAAkE;AAElE,yCAAiD;AACjD,yCAAsC;AAqCtC,MAAa,WAAY,SAAQ,mBAAQ;IAmCxC,GAAG,CAAC,UAAgC,EAAE,UAAU,GAAG,IAAI;QACtD,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,KA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AAO,EAAE;YACR,UAAU,EAAE,OAAO,EAAE,qBAAqB;SAC1C;KACD,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACnB,CAAC;AAxBD,sCAwBC"} \ No newline at end of file +{"version":3,"file":"Permissions.js","sourceRoot":"","sources":["../../src/util/Permissions.ts"],"names":[],"mappings":";;;AAAA,8EAA8E;AAC9E,8DAA8D;AAC9D,6CAA+C;AAC/C,+CAAkE;AAElE,yCAAiD;AACjD,yCAAsC;AAqCtC,MAAa,WAAY,SAAQ,mBAAQ;IAmCxC,GAAG,CAAC,UAAgC,EAAE,UAAU,GAAG,IAAI;QACtD,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,UAAgC,EAAE,UAAU,GAAG,IAAI;QACtD,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5F,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,UAAwC,EAAE,IAAa;QAC/E,6CAA6C;QAC7C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE;YAClD,8BAA8B;YAC9B,yDAAyD;YACzD,oDAAoD;YACpD,gEAAgE;YAChE,OAAO,CAAC,UAAU,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC;YACxD,4CAA4C;YAC5C,iFAAiF;YACjF,yDAAyD;QAC1D,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,KAAa;QAClC,sDAAsD;QACtD,OAAO,KAAK,CAAC,MAA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gBAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjF,IAAI,OAAO,GAA2B,IAAI,CAAC;IAC3C,IAAI,UAAU,EAAE;QACf,OAAO,GAAG,MAAM,sBAAY,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,uBAAuB,CAAC,CAAC;KAClF;IAED,IAAI,UAAU,GAAG,WAAW,CAAC,eAAe,CAAC;QAC5C,IAAI,EAAE;YACL,EAAE,EAAE,OAAO;YACX,KAAK,EAAE,MAAM,CAAC,KAAK;SACnB;QACD,KAAK,EAAE;YACN,KAAK,EAAE,KAAK;SACZ;QACD,OAAO,EAAE;YACR,UAAU,EAAE,OAAO,EAAE,qBAAqB;SAC1C;KACD,CAAC,CAAC;IAEH,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAxBD,sCAwBC"} \ No newline at end of file diff --git a/src/util/Permissions.ts b/src/util/Permissions.ts index 56540b8f..d1d5bc44 100644 --- a/src/util/Permissions.ts +++ b/src/util/Permissions.ts @@ -156,5 +156,5 @@ export async function getPermission(user_id: bigint, guild_id: bigint, channel_i }, }); - return permission; + return new Permissions(permission); }