disgroove 2.0.0-dev.825fc77 → 2.0.1

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.
@@ -23,18 +23,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.RequestManager = exports.RestMethods = void 0;
26
+ exports.RequestManager = exports.RESTMethods = void 0;
27
27
  const constants_1 = require("../constants");
28
28
  const utils_1 = require("../utils");
29
29
  const pkg = __importStar(require("../../package.json"));
30
- var RestMethods;
31
- (function (RestMethods) {
32
- RestMethods["Get"] = "GET";
33
- RestMethods["Post"] = "POST";
34
- RestMethods["Delete"] = "DELETE";
35
- RestMethods["Patch"] = "PATCH";
36
- RestMethods["Put"] = "PUT";
37
- })(RestMethods || (exports.RestMethods = RestMethods = {}));
30
+ var RESTMethods;
31
+ (function (RESTMethods) {
32
+ RESTMethods["Get"] = "GET";
33
+ RESTMethods["Post"] = "POST";
34
+ RESTMethods["Delete"] = "DELETE";
35
+ RESTMethods["Patch"] = "PATCH";
36
+ RESTMethods["Put"] = "PUT";
37
+ })(RESTMethods || (exports.RESTMethods = RESTMethods = {}));
38
38
  class RequestManager {
39
39
  token;
40
40
  auth;
@@ -59,7 +59,7 @@ class RequestManager {
59
59
  let body;
60
60
  if (data?.authorization === false)
61
61
  delete headers["Authorization"];
62
- if (method !== RestMethods.Get) {
62
+ if (method !== RESTMethods.Get) {
63
63
  if (data?.form || (data?.files && data?.files?.length !== 0)) {
64
64
  const formData = data.form ?? new FormData();
65
65
  if (data?.files && data?.files?.length !== 0) {
@@ -103,13 +103,13 @@ class RequestManager {
103
103
  .catch(reject), 5 * 1000);
104
104
  }
105
105
  else {
106
- const responseJson = await response.json();
107
- reject(responseJson &&
108
- typeof responseJson === "object" &&
109
- "code" in responseJson &&
110
- "message" in responseJson &&
111
- responseJson.code !== 0
112
- ? new utils_1.RestError(`[${responseJson.code}] ${responseJson.message}`)
106
+ const responseJSON = await response.json();
107
+ reject(responseJSON &&
108
+ typeof responseJSON === "object" &&
109
+ "code" in responseJSON &&
110
+ "message" in responseJSON &&
111
+ responseJSON.code !== 0
112
+ ? new utils_1.RESTError(`[${responseJSON.code}] ${responseJSON.message}`)
113
113
  : new utils_1.HTTPError(`[${response.status}] ${response.statusText}`));
114
114
  }
115
115
  }
@@ -124,7 +124,7 @@ export interface EditGlobalApplicationCommandParams {
124
124
  dmPermission?: boolean;
125
125
  nsfw?: boolean;
126
126
  }
127
- export interface BulkEditGlobalApplicationCommandParams {
127
+ export type BulkEditGlobalApplicationCommandsParams = Array<{
128
128
  id?: string;
129
129
  name: string;
130
130
  nameLocalizations?: LocaleMap | null;
@@ -136,7 +136,7 @@ export interface BulkEditGlobalApplicationCommandParams {
136
136
  defaultPermission?: boolean | null;
137
137
  type?: ApplicationCommandTypes;
138
138
  nsfw?: boolean;
139
- }
139
+ }>;
140
140
  export interface CreateGuildApplicationCommandParams {
141
141
  name: string;
142
142
  nameLocalizations?: LocaleMap | null;
@@ -158,7 +158,7 @@ export interface EditGuildApplicationCommandParams {
158
158
  defaultPermission?: boolean | null;
159
159
  nsfw?: boolean;
160
160
  }
161
- export interface BulkEditGuildApplicationCommandsParams {
161
+ export type BulkEditGuildApplicationCommandsParams = Array<{
162
162
  id?: string;
163
163
  name: string;
164
164
  nameLocalizations?: LocaleMap | null;
@@ -170,7 +170,7 @@ export interface BulkEditGuildApplicationCommandsParams {
170
170
  defaultPermission?: boolean | null;
171
171
  type: ApplicationCommandTypes;
172
172
  nsfw?: boolean;
173
- }
174
- export interface EditApplicationCommandPermissions {
173
+ }>;
174
+ export interface EditApplicationCommandPermissionsParams {
175
175
  permissions: Array<GuildApplicationCommandPermissions>;
176
176
  }
@@ -401,12 +401,12 @@ export interface CreateGuildChannelParams {
401
401
  defaultForumLayout?: ForumLayoutTypes;
402
402
  defaultThreadRateLimitPerUser?: number;
403
403
  }
404
- export interface EditGuildChannelPositionsParams {
404
+ export type EditGuildChannelPositionsParams = Array<{
405
405
  id: string;
406
406
  position?: number | null;
407
407
  lockPermissions?: boolean | null;
408
408
  parentId?: string | null;
409
- }
409
+ }>;
410
410
  export interface AddGuildMemberParams {
411
411
  accessToken: string;
412
412
  nick?: string;
@@ -442,10 +442,10 @@ export interface CreateGuildRoleParams {
442
442
  unicodeEmoji?: string | null;
443
443
  mentionable?: boolean;
444
444
  }
445
- export interface EditGuildRolePositionsParams {
445
+ export type EditGuildRolePositionsParams = Array<{
446
446
  id: string;
447
447
  position?: number | null;
448
- }
448
+ }>;
449
449
  export interface EditGuildRoleParams {
450
450
  name?: string | null;
451
451
  permissions?: string | null;
@@ -130,12 +130,12 @@ export interface ModalSubmitData {
130
130
  }>;
131
131
  }
132
132
  export interface ResolvedData {
133
- users?: Array<User>;
134
- members?: Array<GuildMember>;
135
- roles?: Array<Role>;
136
- channels?: Array<Channel>;
137
- messages?: Array<Message>;
138
- attachments?: Array<Attachment>;
133
+ users?: Record<string, User>;
134
+ members?: Record<string, GuildMember>;
135
+ roles?: Record<string, Role>;
136
+ channels?: Record<string, Channel>;
137
+ messages?: Record<string, Message>;
138
+ attachments?: Record<string, Attachment>;
139
139
  }
140
140
  export interface ApplicationCommandInteractionDataOption {
141
141
  name: string;
@@ -1,4 +1,4 @@
1
- export declare class RestError extends Error {
1
+ export declare class RESTError extends Error {
2
2
  name: string;
3
3
  constructor(message: string);
4
4
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GatewayError = exports.HTTPError = exports.RestError = void 0;
4
- class RestError extends Error {
5
- name = "RestError";
3
+ exports.GatewayError = exports.HTTPError = exports.RESTError = void 0;
4
+ class RESTError extends Error {
5
+ name = "RESTError";
6
6
  constructor(message) {
7
7
  super(message);
8
8
  }
9
9
  }
10
- exports.RestError = RestError;
10
+ exports.RESTError = RESTError;
11
11
  class HTTPError extends Error {
12
12
  name = "HTTPError";
13
13
  constructor(message) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.0.0-dev.825fc77",
3
+ "version": "2.0.1",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -9,11 +9,11 @@
9
9
  "url": "git+https://github.com/XenKys/disgroove.git"
10
10
  },
11
11
  "keywords": [
12
- "discord",
13
12
  "api",
13
+ "bot",
14
+ "discord",
14
15
  "gateway",
15
- "wrapper",
16
- "bot"
16
+ "wrapper"
17
17
  ],
18
18
  "author": "XenKys",
19
19
  "license": "MIT",
@@ -21,10 +21,12 @@
21
21
  "url": "https://github.com/XenKys/disgroove/issues"
22
22
  },
23
23
  "homepage": "https://github.com/XenKys/disgroove#readme",
24
- "dependencies": {
25
- "@types/node": "^20.11.24",
24
+ "devDependencies": {
25
+ "@types/node": "^20.11.25",
26
26
  "@types/ws": "^8.5.10",
27
- "node": "^21.6.2",
27
+ "node": "^21.7.1"
28
+ },
29
+ "dependencies": {
28
30
  "ws": "^8.16.0"
29
31
  }
30
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.0.0-dev.825fc77",
3
+ "version": "2.0.1",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -9,11 +9,11 @@
9
9
  "url": "git+https://github.com/XenKys/disgroove.git"
10
10
  },
11
11
  "keywords": [
12
- "discord",
13
12
  "api",
13
+ "bot",
14
+ "discord",
14
15
  "gateway",
15
- "wrapper",
16
- "bot"
16
+ "wrapper"
17
17
  ],
18
18
  "author": "XenKys",
19
19
  "license": "MIT",
@@ -21,10 +21,12 @@
21
21
  "url": "https://github.com/XenKys/disgroove/issues"
22
22
  },
23
23
  "homepage": "https://github.com/XenKys/disgroove#readme",
24
- "dependencies": {
25
- "@types/node": "^20.11.24",
24
+ "devDependencies": {
25
+ "@types/node": "^20.11.25",
26
26
  "@types/ws": "^8.5.10",
27
- "node": "^21.6.2",
27
+ "node": "^21.7.1"
28
+ },
29
+ "dependencies": {
28
30
  "ws": "^8.16.0"
29
31
  }
30
32
  }