@ovencord/rest 2.5.4 → 2.5.6

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@ovencord/rest",
4
- "version": "2.5.4",
4
+ "version": "2.5.6",
5
5
  "description": "The REST API for discord.js",
6
6
  "scripts": {
7
7
  "test": "bun test",
package/src/lib/REST.ts CHANGED
@@ -385,7 +385,7 @@ export class REST extends AsyncEventEmitter<RestEvents> {
385
385
  // eslint-disable-next-line no-eq-null, eqeqeq
386
386
  } else if (request.body != null) {
387
387
  if (request.passThroughBody) {
388
- finalBody = request.body as BodyInit;
388
+ finalBody = request.body as any;
389
389
  } else {
390
390
  // Stringify the JSON data
391
391
  finalBody = JSON.stringify(request.body, (_, value) =>
@@ -120,7 +120,7 @@ export async function makeNetworkRequest(
120
120
  data: requestData,
121
121
  retries,
122
122
  },
123
- res instanceof Response ? res.clone() : { ...res },
123
+ (res instanceof Response ? res.clone() : { ...res }) as any,
124
124
  );
125
125
  }
126
126
 
@@ -15,6 +15,7 @@ export const DefaultUserAgent =
15
15
  export const DefaultUserAgentAppendix = getUserAgentAppendix();
16
16
 
17
17
  export const DefaultRestOptions = {
18
+ // @ts-ignore
18
19
  agent: null,
19
20
  api: 'https://discord.com/api',
20
21
  authPrefix: 'Bot',
@@ -23,6 +24,7 @@ export const DefaultRestOptions = {
23
24
  invalidRequestWarningInterval: 0,
24
25
  globalRequestsPerSecond: 50,
25
26
  offset: 50,
27
+ // @ts-ignore
26
28
  rejectOnRateLimit: null,
27
29
  retries: 3,
28
30
  retryBackoff: 0,
@@ -313,7 +313,7 @@ export interface RequestData {
313
313
  * The body to send to this request.
314
314
  * If providing as BodyInit, set `passThroughBody: true`
315
315
  */
316
- body?: BodyInit | unknown;
316
+ body?: unknown;
317
317
  /**
318
318
  * The {@link https://undici.nodejs.org/#/docs/api/Agent | Agent} to use for the request.
319
319
  *