@discordjs/core 0.6.1-dev.1689249919-ceab07b.0 → 0.6.1-dev.1689595487-afa9879.0
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/{files-460c6b65.d.ts → files-a4ec71a4.d.ts} +4 -3
- package/dist/http-only.d.mts +11 -0
- package/dist/http-only.d.ts +1 -1
- package/dist/http-only.js +55 -20
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +55 -20
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +151 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +58 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
|
@@ -1098,10 +1098,11 @@ declare class WebhooksAPI {
|
|
|
1098
1098
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
|
|
1099
1099
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
|
1100
1100
|
* @param id - The id of the webhook
|
|
1101
|
-
* @param token - The token of the webhook
|
|
1102
1101
|
* @param options - The options for fetching the webhook
|
|
1103
1102
|
*/
|
|
1104
|
-
get(id: Snowflake, token
|
|
1103
|
+
get(id: Snowflake, { token, signal }?: Pick<RequestData, 'signal'> & {
|
|
1104
|
+
token?: string | undefined;
|
|
1105
|
+
}): Promise<discord_api_types_v10.APIWebhook>;
|
|
1105
1106
|
/**
|
|
1106
1107
|
* Edits a webhook
|
|
1107
1108
|
*
|
|
@@ -1686,7 +1687,7 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
1686
1687
|
};
|
|
1687
1688
|
files: {
|
|
1688
1689
|
name: string;
|
|
1689
|
-
data: string | number | boolean | Buffer;
|
|
1690
|
+
data: string | number | boolean | Uint8Array | Buffer;
|
|
1690
1691
|
}[];
|
|
1691
1692
|
};
|
|
1692
1693
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { A as API, a as ApplicationCommandsAPI, C as ChannelsAPI, D as DescriptiveRawFile, G as GuildsAPI, I as InteractionsAPI, b as InvitesAPI, O as OAuth2API, R as RoleConnectionsAPI, c as StageInstancesAPI, S as StartForumThreadOptions, d as StickersAPI, T as ThreadsAPI, U as UsersAPI, V as VoiceAPI, W as WebhooksAPI, w as withFiles } from './files-a4ec71a4.js';
|
|
2
|
+
export * from 'discord-api-types/v10';
|
|
3
|
+
import '@discordjs/rest';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/core/#readme | @discordjs/core} version
|
|
7
|
+
* that you are currently using.
|
|
8
|
+
*/
|
|
9
|
+
declare const version: string;
|
|
10
|
+
|
|
11
|
+
export { version };
|
package/dist/http-only.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as API, a as ApplicationCommandsAPI, C as ChannelsAPI, D as DescriptiveRawFile, G as GuildsAPI, I as InteractionsAPI, b as InvitesAPI, O as OAuth2API, R as RoleConnectionsAPI, c as StageInstancesAPI, S as StartForumThreadOptions, d as StickersAPI, T as ThreadsAPI, U as UsersAPI, V as VoiceAPI, W as WebhooksAPI, w as withFiles } from './files-
|
|
1
|
+
export { A as API, a as ApplicationCommandsAPI, C as ChannelsAPI, D as DescriptiveRawFile, G as GuildsAPI, I as InteractionsAPI, b as InvitesAPI, O as OAuth2API, R as RoleConnectionsAPI, c as StageInstancesAPI, S as StartForumThreadOptions, d as StickersAPI, T as ThreadsAPI, U as UsersAPI, V as VoiceAPI, W as WebhooksAPI, w as withFiles } from './files-a4ec71a4.js';
|
|
2
2
|
export * from 'discord-api-types/v10';
|
|
3
3
|
import '@discordjs/rest';
|
|
4
4
|
|
package/dist/http-only.js
CHANGED
|
@@ -48,6 +48,9 @@ var ApplicationCommandsAPI = class {
|
|
|
48
48
|
constructor(rest) {
|
|
49
49
|
this.rest = rest;
|
|
50
50
|
}
|
|
51
|
+
static {
|
|
52
|
+
__name(this, "ApplicationCommandsAPI");
|
|
53
|
+
}
|
|
51
54
|
/**
|
|
52
55
|
* Fetches all global commands for a application
|
|
53
56
|
*
|
|
@@ -263,7 +266,6 @@ var ApplicationCommandsAPI = class {
|
|
|
263
266
|
});
|
|
264
267
|
}
|
|
265
268
|
};
|
|
266
|
-
__name(ApplicationCommandsAPI, "ApplicationCommandsAPI");
|
|
267
269
|
|
|
268
270
|
// src/api/channel.ts
|
|
269
271
|
var import_rest2 = require("@discordjs/rest");
|
|
@@ -272,6 +274,9 @@ var ChannelsAPI = class {
|
|
|
272
274
|
constructor(rest) {
|
|
273
275
|
this.rest = rest;
|
|
274
276
|
}
|
|
277
|
+
static {
|
|
278
|
+
__name(this, "ChannelsAPI");
|
|
279
|
+
}
|
|
275
280
|
/**
|
|
276
281
|
* Sends a message in a channel
|
|
277
282
|
*
|
|
@@ -674,7 +679,6 @@ var ChannelsAPI = class {
|
|
|
674
679
|
});
|
|
675
680
|
}
|
|
676
681
|
};
|
|
677
|
-
__name(ChannelsAPI, "ChannelsAPI");
|
|
678
682
|
|
|
679
683
|
// src/api/guild.ts
|
|
680
684
|
var import_rest3 = require("@discordjs/rest");
|
|
@@ -683,6 +687,9 @@ var GuildsAPI = class {
|
|
|
683
687
|
constructor(rest) {
|
|
684
688
|
this.rest = rest;
|
|
685
689
|
}
|
|
690
|
+
static {
|
|
691
|
+
__name(this, "GuildsAPI");
|
|
692
|
+
}
|
|
686
693
|
/**
|
|
687
694
|
* Fetches a guild
|
|
688
695
|
*
|
|
@@ -1570,7 +1577,6 @@ var GuildsAPI = class {
|
|
|
1570
1577
|
return this.rest.get(import_v103.Routes.guildOnboarding(guildId), { signal });
|
|
1571
1578
|
}
|
|
1572
1579
|
};
|
|
1573
|
-
__name(GuildsAPI, "GuildsAPI");
|
|
1574
1580
|
|
|
1575
1581
|
// src/api/interactions.ts
|
|
1576
1582
|
var import_v104 = require("discord-api-types/v10");
|
|
@@ -1579,6 +1585,9 @@ var InteractionsAPI = class {
|
|
|
1579
1585
|
this.rest = rest;
|
|
1580
1586
|
this.webhooks = webhooks;
|
|
1581
1587
|
}
|
|
1588
|
+
static {
|
|
1589
|
+
__name(this, "InteractionsAPI");
|
|
1590
|
+
}
|
|
1582
1591
|
/**
|
|
1583
1592
|
* Replies to an interaction
|
|
1584
1593
|
*
|
|
@@ -1752,7 +1761,6 @@ var InteractionsAPI = class {
|
|
|
1752
1761
|
});
|
|
1753
1762
|
}
|
|
1754
1763
|
};
|
|
1755
|
-
__name(InteractionsAPI, "InteractionsAPI");
|
|
1756
1764
|
|
|
1757
1765
|
// src/api/invite.ts
|
|
1758
1766
|
var import_rest4 = require("@discordjs/rest");
|
|
@@ -1761,6 +1769,9 @@ var InvitesAPI = class {
|
|
|
1761
1769
|
constructor(rest) {
|
|
1762
1770
|
this.rest = rest;
|
|
1763
1771
|
}
|
|
1772
|
+
static {
|
|
1773
|
+
__name(this, "InvitesAPI");
|
|
1774
|
+
}
|
|
1764
1775
|
/**
|
|
1765
1776
|
* Fetches an invite
|
|
1766
1777
|
*
|
|
@@ -1786,7 +1797,6 @@ var InvitesAPI = class {
|
|
|
1786
1797
|
await this.rest.delete(import_v105.Routes.invite(code), { reason, signal });
|
|
1787
1798
|
}
|
|
1788
1799
|
};
|
|
1789
|
-
__name(InvitesAPI, "InvitesAPI");
|
|
1790
1800
|
|
|
1791
1801
|
// src/api/oauth2.ts
|
|
1792
1802
|
var import_node_url = require("url");
|
|
@@ -1796,6 +1806,9 @@ var OAuth2API = class {
|
|
|
1796
1806
|
constructor(rest) {
|
|
1797
1807
|
this.rest = rest;
|
|
1798
1808
|
}
|
|
1809
|
+
static {
|
|
1810
|
+
__name(this, "OAuth2API");
|
|
1811
|
+
}
|
|
1799
1812
|
/**
|
|
1800
1813
|
* Creates an OAuth2 authorization URL given the options
|
|
1801
1814
|
*
|
|
@@ -1883,7 +1896,6 @@ var OAuth2API = class {
|
|
|
1883
1896
|
});
|
|
1884
1897
|
}
|
|
1885
1898
|
};
|
|
1886
|
-
__name(OAuth2API, "OAuth2API");
|
|
1887
1899
|
|
|
1888
1900
|
// src/api/roleConnections.ts
|
|
1889
1901
|
var import_v107 = require("discord-api-types/v10");
|
|
@@ -1891,6 +1903,9 @@ var RoleConnectionsAPI = class {
|
|
|
1891
1903
|
constructor(rest) {
|
|
1892
1904
|
this.rest = rest;
|
|
1893
1905
|
}
|
|
1906
|
+
static {
|
|
1907
|
+
__name(this, "RoleConnectionsAPI");
|
|
1908
|
+
}
|
|
1894
1909
|
/**
|
|
1895
1910
|
* Gets the role connection metadata records for the application
|
|
1896
1911
|
*
|
|
@@ -1918,7 +1933,6 @@ var RoleConnectionsAPI = class {
|
|
|
1918
1933
|
});
|
|
1919
1934
|
}
|
|
1920
1935
|
};
|
|
1921
|
-
__name(RoleConnectionsAPI, "RoleConnectionsAPI");
|
|
1922
1936
|
|
|
1923
1937
|
// src/api/stageInstances.ts
|
|
1924
1938
|
var import_v108 = require("discord-api-types/v10");
|
|
@@ -1926,6 +1940,9 @@ var StageInstancesAPI = class {
|
|
|
1926
1940
|
constructor(rest) {
|
|
1927
1941
|
this.rest = rest;
|
|
1928
1942
|
}
|
|
1943
|
+
static {
|
|
1944
|
+
__name(this, "StageInstancesAPI");
|
|
1945
|
+
}
|
|
1929
1946
|
/**
|
|
1930
1947
|
* Creates a new stage instance
|
|
1931
1948
|
*
|
|
@@ -1976,7 +1993,6 @@ var StageInstancesAPI = class {
|
|
|
1976
1993
|
await this.rest.delete(import_v108.Routes.stageInstance(channelId), { reason, signal });
|
|
1977
1994
|
}
|
|
1978
1995
|
};
|
|
1979
|
-
__name(StageInstancesAPI, "StageInstancesAPI");
|
|
1980
1996
|
|
|
1981
1997
|
// src/api/sticker.ts
|
|
1982
1998
|
var import_v109 = require("discord-api-types/v10");
|
|
@@ -1984,6 +2000,9 @@ var StickersAPI = class {
|
|
|
1984
2000
|
constructor(rest) {
|
|
1985
2001
|
this.rest = rest;
|
|
1986
2002
|
}
|
|
2003
|
+
static {
|
|
2004
|
+
__name(this, "StickersAPI");
|
|
2005
|
+
}
|
|
1987
2006
|
/**
|
|
1988
2007
|
* Fetches all of the nitro sticker packs
|
|
1989
2008
|
*
|
|
@@ -2004,7 +2023,6 @@ var StickersAPI = class {
|
|
|
2004
2023
|
return this.rest.get(import_v109.Routes.sticker(stickerId), { signal });
|
|
2005
2024
|
}
|
|
2006
2025
|
};
|
|
2007
|
-
__name(StickersAPI, "StickersAPI");
|
|
2008
2026
|
|
|
2009
2027
|
// src/api/thread.ts
|
|
2010
2028
|
var import_v1010 = require("discord-api-types/v10");
|
|
@@ -2012,6 +2030,9 @@ var ThreadsAPI = class {
|
|
|
2012
2030
|
constructor(rest) {
|
|
2013
2031
|
this.rest = rest;
|
|
2014
2032
|
}
|
|
2033
|
+
static {
|
|
2034
|
+
__name(this, "ThreadsAPI");
|
|
2035
|
+
}
|
|
2015
2036
|
/**
|
|
2016
2037
|
* Adds the current user to a thread
|
|
2017
2038
|
*
|
|
@@ -2076,7 +2097,6 @@ var ThreadsAPI = class {
|
|
|
2076
2097
|
return this.rest.get(import_v1010.Routes.threadMembers(threadId), { signal });
|
|
2077
2098
|
}
|
|
2078
2099
|
};
|
|
2079
|
-
__name(ThreadsAPI, "ThreadsAPI");
|
|
2080
2100
|
|
|
2081
2101
|
// src/api/user.ts
|
|
2082
2102
|
var import_rest6 = require("@discordjs/rest");
|
|
@@ -2085,6 +2105,9 @@ var UsersAPI = class {
|
|
|
2085
2105
|
constructor(rest) {
|
|
2086
2106
|
this.rest = rest;
|
|
2087
2107
|
}
|
|
2108
|
+
static {
|
|
2109
|
+
__name(this, "UsersAPI");
|
|
2110
|
+
}
|
|
2088
2111
|
/**
|
|
2089
2112
|
* Fetches a user by their id
|
|
2090
2113
|
*
|
|
@@ -2211,7 +2234,6 @@ var UsersAPI = class {
|
|
|
2211
2234
|
});
|
|
2212
2235
|
}
|
|
2213
2236
|
};
|
|
2214
|
-
__name(UsersAPI, "UsersAPI");
|
|
2215
2237
|
|
|
2216
2238
|
// src/api/voice.ts
|
|
2217
2239
|
var import_v1012 = require("discord-api-types/v10");
|
|
@@ -2219,6 +2241,9 @@ var VoiceAPI = class {
|
|
|
2219
2241
|
constructor(rest) {
|
|
2220
2242
|
this.rest = rest;
|
|
2221
2243
|
}
|
|
2244
|
+
static {
|
|
2245
|
+
__name(this, "VoiceAPI");
|
|
2246
|
+
}
|
|
2222
2247
|
/**
|
|
2223
2248
|
* Fetches all voice regions
|
|
2224
2249
|
*
|
|
@@ -2229,7 +2254,6 @@ var VoiceAPI = class {
|
|
|
2229
2254
|
return this.rest.get(import_v1012.Routes.voiceRegions(), { signal });
|
|
2230
2255
|
}
|
|
2231
2256
|
};
|
|
2232
|
-
__name(VoiceAPI, "VoiceAPI");
|
|
2233
2257
|
|
|
2234
2258
|
// src/api/webhook.ts
|
|
2235
2259
|
var import_rest7 = require("@discordjs/rest");
|
|
@@ -2238,17 +2262,22 @@ var WebhooksAPI = class {
|
|
|
2238
2262
|
constructor(rest) {
|
|
2239
2263
|
this.rest = rest;
|
|
2240
2264
|
}
|
|
2265
|
+
static {
|
|
2266
|
+
__name(this, "WebhooksAPI");
|
|
2267
|
+
}
|
|
2241
2268
|
/**
|
|
2242
2269
|
* Fetches a webhook
|
|
2243
2270
|
*
|
|
2244
2271
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
|
|
2245
2272
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
|
2246
2273
|
* @param id - The id of the webhook
|
|
2247
|
-
* @param token - The token of the webhook
|
|
2248
2274
|
* @param options - The options for fetching the webhook
|
|
2249
2275
|
*/
|
|
2250
|
-
async get(id, token,
|
|
2251
|
-
return this.rest.get(import_v1013.Routes.webhook(id, token), {
|
|
2276
|
+
async get(id, { token, signal } = {}) {
|
|
2277
|
+
return this.rest.get(import_v1013.Routes.webhook(id, token), {
|
|
2278
|
+
signal,
|
|
2279
|
+
auth: !token
|
|
2280
|
+
});
|
|
2252
2281
|
}
|
|
2253
2282
|
/**
|
|
2254
2283
|
* Edits a webhook
|
|
@@ -2263,7 +2292,8 @@ var WebhooksAPI = class {
|
|
|
2263
2292
|
return this.rest.patch(import_v1013.Routes.webhook(id, token), {
|
|
2264
2293
|
reason,
|
|
2265
2294
|
body,
|
|
2266
|
-
signal
|
|
2295
|
+
signal,
|
|
2296
|
+
auth: !token
|
|
2267
2297
|
});
|
|
2268
2298
|
}
|
|
2269
2299
|
/**
|
|
@@ -2275,7 +2305,11 @@ var WebhooksAPI = class {
|
|
|
2275
2305
|
* @param options - The options for deleting the webhook
|
|
2276
2306
|
*/
|
|
2277
2307
|
async delete(id, { token, reason, signal } = {}) {
|
|
2278
|
-
await this.rest.delete(import_v1013.Routes.webhook(id, token), {
|
|
2308
|
+
await this.rest.delete(import_v1013.Routes.webhook(id, token), {
|
|
2309
|
+
reason,
|
|
2310
|
+
signal,
|
|
2311
|
+
auth: !token
|
|
2312
|
+
});
|
|
2279
2313
|
}
|
|
2280
2314
|
/**
|
|
2281
2315
|
* Executes a webhook
|
|
@@ -2395,7 +2429,6 @@ var WebhooksAPI = class {
|
|
|
2395
2429
|
});
|
|
2396
2430
|
}
|
|
2397
2431
|
};
|
|
2398
|
-
__name(WebhooksAPI, "WebhooksAPI");
|
|
2399
2432
|
|
|
2400
2433
|
// src/api/index.ts
|
|
2401
2434
|
var API = class {
|
|
@@ -2415,6 +2448,9 @@ var API = class {
|
|
|
2415
2448
|
this.webhooks = new WebhooksAPI(rest);
|
|
2416
2449
|
this.interactions = new InteractionsAPI(rest, this.webhooks);
|
|
2417
2450
|
}
|
|
2451
|
+
static {
|
|
2452
|
+
__name(this, "API");
|
|
2453
|
+
}
|
|
2418
2454
|
applicationCommands;
|
|
2419
2455
|
channels;
|
|
2420
2456
|
guilds;
|
|
@@ -2429,7 +2465,6 @@ var API = class {
|
|
|
2429
2465
|
voice;
|
|
2430
2466
|
webhooks;
|
|
2431
2467
|
};
|
|
2432
|
-
__name(API, "API");
|
|
2433
2468
|
|
|
2434
2469
|
// src/util/files.ts
|
|
2435
2470
|
function withFiles(files, options) {
|
|
@@ -2450,7 +2485,7 @@ __name(withFiles, "withFiles");
|
|
|
2450
2485
|
|
|
2451
2486
|
// src/http-only/index.ts
|
|
2452
2487
|
__reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
|
|
2453
|
-
var version = "0.6.1-dev.
|
|
2488
|
+
var version = "0.6.1-dev.1689595487-afa9879.0";
|
|
2454
2489
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2455
2490
|
0 && (module.exports = {
|
|
2456
2491
|
API,
|