@discordjs/rest 3.0.0-dev.1764720113-633fdd8f2 → 3.0.0-dev.1765065716-5e6bd4b3d
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/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/dist/strategies/undiciRequest.js +5 -0
- package/dist/strategies/undiciRequest.js.map +1 -1
- package/dist/strategies/undiciRequest.mjs +6 -1
- package/dist/strategies/undiciRequest.mjs.map +1 -1
- package/dist/web.js +2 -2
- package/dist/web.js.map +1 -1
- package/dist/web.mjs +2 -2
- package/dist/web.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -61,11 +61,16 @@ var import_node_http = require("http");
|
|
|
61
61
|
var import_node_url = require("url");
|
|
62
62
|
var import_node_util = require("util");
|
|
63
63
|
var import_undici = require("undici");
|
|
64
|
+
var localAgent = null;
|
|
64
65
|
async function makeRequest(url, init) {
|
|
65
66
|
const options = {
|
|
66
67
|
...init,
|
|
67
68
|
body: await resolveBody(init.body)
|
|
68
69
|
};
|
|
70
|
+
if (!options.dispatcher) {
|
|
71
|
+
localAgent ??= new import_undici.Agent();
|
|
72
|
+
options.dispatcher = localAgent;
|
|
73
|
+
}
|
|
69
74
|
const res = await (0, import_undici.request)(url, options);
|
|
70
75
|
return {
|
|
71
76
|
body: res.body,
|
|
@@ -139,7 +144,7 @@ var import_v102 = require("discord-api-types/v10");
|
|
|
139
144
|
// src/lib/utils/constants.ts
|
|
140
145
|
var import_util = require("@discordjs/util");
|
|
141
146
|
var import_v10 = require("discord-api-types/v10");
|
|
142
|
-
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 3.0.0-dev.
|
|
147
|
+
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 3.0.0-dev.1765065716-5e6bd4b3d)`;
|
|
143
148
|
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
|
|
144
149
|
var DefaultRestOptions = {
|
|
145
150
|
agent: null,
|
|
@@ -1540,7 +1545,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
1540
1545
|
};
|
|
1541
1546
|
|
|
1542
1547
|
// src/shared.ts
|
|
1543
|
-
var version = "3.0.0-dev.
|
|
1548
|
+
var version = "3.0.0-dev.1765065716-5e6bd4b3d";
|
|
1544
1549
|
|
|
1545
1550
|
// src/index.ts
|
|
1546
1551
|
setDefaultStrategy((0, import_util2.shouldUseGlobalFetchAndWebSocket)() ? fetch : makeRequest);
|