disgroove 3.0.0-dev.72bf12 → 3.0.0-dev.7dc321a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,8 +47,12 @@ class HTTPError extends Error {
47
47
  exports.HTTPError = HTTPError;
48
48
  class GatewayError extends Error {
49
49
  name = "GatewayError";
50
+ code;
51
+ reason;
50
52
  constructor(code, reason) {
51
53
  super(`[${code}] ${reason}`);
54
+ this.code = code;
55
+ this.reason = reason;
52
56
  }
53
57
  }
54
58
  exports.GatewayError = GatewayError;
@@ -1,3 +1,4 @@
1
1
  export * as CDN from "./CDN";
2
2
  export * from "./errors";
3
3
  export * from "./formatters";
4
+ export * from "./permissions";
@@ -40,3 +40,4 @@ exports.CDN = void 0;
40
40
  exports.CDN = __importStar(require("./CDN"));
41
41
  __exportStar(require("./errors"), exports);
42
42
  __exportStar(require("./formatters"), exports);
43
+ __exportStar(require("./permissions"), exports);
@@ -0,0 +1,2 @@
1
+ /** https://discord.com/developers/docs/topics/permissions */
2
+ export declare function hasPermission(userPermissions: string, permission: bigint): boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasPermission = hasPermission;
4
+ /** https://discord.com/developers/docs/topics/permissions */
5
+ function hasPermission(userPermissions, permission) {
6
+ return (BigInt(userPermissions) & permission) === permission;
7
+ }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "3.0.0-dev.72bf12",
3
+ "version": "3.0.0-dev.7dc321a",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "3.0.0-dev.72bf12",
3
+ "version": "3.0.0-dev.7dc321a",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -33,4 +33,4 @@
33
33
  "dependencies": {
34
34
  "ws": "^8.18.3"
35
35
  }
36
- }
36
+ }