@ovencord/rest 2.5.2 → 2.5.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/lib/REST.ts +7 -2
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.2",
4
+ "version": "2.5.3",
5
5
  "description": "The REST API for discord.js",
6
6
  "scripts": {
7
7
  "test": "bun test",
package/src/lib/REST.ts CHANGED
@@ -372,7 +372,10 @@ export class REST extends AsyncEventEmitter<RestEvents> {
372
372
  formData.append(key, value as string | Blob);
373
373
  }
374
374
  } else {
375
- formData.append('payload_json', JSON.stringify(request.body));
375
+ formData.append(
376
+ 'payload_json',
377
+ JSON.stringify(request.body, (_, value) => (typeof value === 'bigint' ? value.toString() : value)),
378
+ );
376
379
  }
377
380
  }
378
381
 
@@ -385,7 +388,9 @@ export class REST extends AsyncEventEmitter<RestEvents> {
385
388
  finalBody = request.body as BodyInit;
386
389
  } else {
387
390
  // Stringify the JSON data
388
- finalBody = JSON.stringify(request.body);
391
+ finalBody = JSON.stringify(request.body, (_, value) =>
392
+ typeof value === 'bigint' ? value.toString() : value,
393
+ );
389
394
  // Set the additional headers to specify the content-type
390
395
  additionalHeaders = { 'Content-Type': 'application/json' };
391
396
  }