@discordjs/core 2.4.0 → 2.6.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/README.md +9 -8
- package/dist/http-only.d.mts +42 -16
- package/dist/http-only.d.ts +42 -16
- package/dist/http-only.js +62 -3
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +65 -4
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +42 -16
- package/dist/index.d.ts +42 -16
- package/dist/index.js +62 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/http-only.mjs
CHANGED
|
@@ -10,6 +10,7 @@ var ApplicationCommandsAPI = class {
|
|
|
10
10
|
constructor(rest) {
|
|
11
11
|
this.rest = rest;
|
|
12
12
|
}
|
|
13
|
+
rest;
|
|
13
14
|
static {
|
|
14
15
|
__name(this, "ApplicationCommandsAPI");
|
|
15
16
|
}
|
|
@@ -237,6 +238,7 @@ var ApplicationsAPI = class {
|
|
|
237
238
|
constructor(rest) {
|
|
238
239
|
this.rest = rest;
|
|
239
240
|
}
|
|
241
|
+
rest;
|
|
240
242
|
static {
|
|
241
243
|
__name(this, "ApplicationsAPI");
|
|
242
244
|
}
|
|
@@ -327,6 +329,19 @@ var ApplicationsAPI = class {
|
|
|
327
329
|
async deleteEmoji(applicationId, emojiId, { signal } = {}) {
|
|
328
330
|
await this.rest.delete(Routes2.applicationEmoji(applicationId, emojiId), { signal });
|
|
329
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* Fetches an activity instance of an application
|
|
334
|
+
*
|
|
335
|
+
* @see {@link https://docs.discord.com/developers/resources/application#get-application-activity-instance}
|
|
336
|
+
* @param applicationId - The id of the application to fetch the activity instance of
|
|
337
|
+
* @param instanceId - The id of the activity instance to fetch
|
|
338
|
+
* @param options - The options for fetching the activity instance
|
|
339
|
+
*/
|
|
340
|
+
async getActivityInstance(applicationId, instanceId, { signal } = {}) {
|
|
341
|
+
return this.rest.get(Routes2.applicationActivityInstance(applicationId, instanceId), {
|
|
342
|
+
signal
|
|
343
|
+
});
|
|
344
|
+
}
|
|
330
345
|
};
|
|
331
346
|
|
|
332
347
|
// src/api/channel.ts
|
|
@@ -338,6 +353,7 @@ var ChannelsAPI = class {
|
|
|
338
353
|
constructor(rest) {
|
|
339
354
|
this.rest = rest;
|
|
340
355
|
}
|
|
356
|
+
rest;
|
|
341
357
|
static {
|
|
342
358
|
__name(this, "ChannelsAPI");
|
|
343
359
|
}
|
|
@@ -762,7 +778,7 @@ var ChannelsAPI = class {
|
|
|
762
778
|
* @param options - The options for sending the soundboard sound
|
|
763
779
|
*/
|
|
764
780
|
async sendSoundboardSound(channelId, body, { signal } = {}) {
|
|
765
|
-
|
|
781
|
+
await this.rest.post(Routes3.sendSoundboardSound(channelId), {
|
|
766
782
|
body,
|
|
767
783
|
signal
|
|
768
784
|
});
|
|
@@ -803,6 +819,7 @@ var GatewayAPI = class {
|
|
|
803
819
|
constructor(rest) {
|
|
804
820
|
this.rest = rest;
|
|
805
821
|
}
|
|
822
|
+
rest;
|
|
806
823
|
static {
|
|
807
824
|
__name(this, "GatewayAPI");
|
|
808
825
|
}
|
|
@@ -843,6 +860,7 @@ var VoiceAPI = class {
|
|
|
843
860
|
constructor(rest) {
|
|
844
861
|
this.rest = rest;
|
|
845
862
|
}
|
|
863
|
+
rest;
|
|
846
864
|
static {
|
|
847
865
|
__name(this, "VoiceAPI");
|
|
848
866
|
}
|
|
@@ -914,6 +932,7 @@ var GuildsAPI = class {
|
|
|
914
932
|
constructor(rest) {
|
|
915
933
|
this.rest = rest;
|
|
916
934
|
}
|
|
935
|
+
rest;
|
|
917
936
|
static {
|
|
918
937
|
__name(this, "GuildsAPI");
|
|
919
938
|
}
|
|
@@ -1744,6 +1763,20 @@ var GuildsAPI = class {
|
|
|
1744
1763
|
signal
|
|
1745
1764
|
});
|
|
1746
1765
|
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Searches for messages.
|
|
1768
|
+
*
|
|
1769
|
+
* @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
|
|
1770
|
+
* @param guildId - The id of the guild to search in
|
|
1771
|
+
* @param query - The query to search for
|
|
1772
|
+
* @param options - The options for searching for messages
|
|
1773
|
+
*/
|
|
1774
|
+
async searchForMessages(guildId, query, { signal } = {}) {
|
|
1775
|
+
return this.rest.get(Routes6.guildMessagesSearch(guildId), {
|
|
1776
|
+
query: makeURLSearchParams3(query),
|
|
1777
|
+
signal
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1747
1780
|
/**
|
|
1748
1781
|
* Edits a guild member
|
|
1749
1782
|
*
|
|
@@ -1943,6 +1976,18 @@ var GuildsAPI = class {
|
|
|
1943
1976
|
signal
|
|
1944
1977
|
});
|
|
1945
1978
|
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Fetches role member counts for a guild.
|
|
1981
|
+
*
|
|
1982
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts}
|
|
1983
|
+
* @param guildId - The id of the guild to fetch role member counts for
|
|
1984
|
+
* @param options - The options for fetching role member counts
|
|
1985
|
+
*/
|
|
1986
|
+
async getRoleMemberCounts(guildId, { signal } = {}) {
|
|
1987
|
+
return this.rest.get(Routes6.guildRoleMemberCounts(guildId), {
|
|
1988
|
+
signal
|
|
1989
|
+
});
|
|
1990
|
+
}
|
|
1946
1991
|
};
|
|
1947
1992
|
|
|
1948
1993
|
// src/api/interactions.ts
|
|
@@ -1956,6 +2001,8 @@ var InteractionsAPI = class {
|
|
|
1956
2001
|
this.rest = rest;
|
|
1957
2002
|
this.webhooks = webhooks;
|
|
1958
2003
|
}
|
|
2004
|
+
rest;
|
|
2005
|
+
webhooks;
|
|
1959
2006
|
static {
|
|
1960
2007
|
__name(this, "InteractionsAPI");
|
|
1961
2008
|
}
|
|
@@ -2123,11 +2170,14 @@ var InteractionsAPI = class {
|
|
|
2123
2170
|
|
|
2124
2171
|
// src/api/invite.ts
|
|
2125
2172
|
import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
|
|
2126
|
-
import {
|
|
2173
|
+
import {
|
|
2174
|
+
Routes as Routes8
|
|
2175
|
+
} from "discord-api-types/v10";
|
|
2127
2176
|
var InvitesAPI = class {
|
|
2128
2177
|
constructor(rest) {
|
|
2129
2178
|
this.rest = rest;
|
|
2130
2179
|
}
|
|
2180
|
+
rest;
|
|
2131
2181
|
static {
|
|
2132
2182
|
__name(this, "InvitesAPI");
|
|
2133
2183
|
}
|
|
@@ -2153,7 +2203,7 @@ var InvitesAPI = class {
|
|
|
2153
2203
|
* @param options - The options for deleting the invite
|
|
2154
2204
|
*/
|
|
2155
2205
|
async delete(code, { reason, signal } = {}) {
|
|
2156
|
-
|
|
2206
|
+
return this.rest.delete(Routes8.invite(code), { reason, signal });
|
|
2157
2207
|
}
|
|
2158
2208
|
};
|
|
2159
2209
|
|
|
@@ -2166,6 +2216,7 @@ var MonetizationAPI = class {
|
|
|
2166
2216
|
constructor(rest) {
|
|
2167
2217
|
this.rest = rest;
|
|
2168
2218
|
}
|
|
2219
|
+
rest;
|
|
2169
2220
|
static {
|
|
2170
2221
|
__name(this, "MonetizationAPI");
|
|
2171
2222
|
}
|
|
@@ -2281,6 +2332,7 @@ var OAuth2API = class {
|
|
|
2281
2332
|
constructor(rest) {
|
|
2282
2333
|
this.rest = rest;
|
|
2283
2334
|
}
|
|
2335
|
+
rest;
|
|
2284
2336
|
static {
|
|
2285
2337
|
__name(this, "OAuth2API");
|
|
2286
2338
|
}
|
|
@@ -2405,6 +2457,7 @@ var PollAPI = class {
|
|
|
2405
2457
|
constructor(rest) {
|
|
2406
2458
|
this.rest = rest;
|
|
2407
2459
|
}
|
|
2460
|
+
rest;
|
|
2408
2461
|
static {
|
|
2409
2462
|
__name(this, "PollAPI");
|
|
2410
2463
|
}
|
|
@@ -2447,6 +2500,7 @@ var RoleConnectionsAPI = class {
|
|
|
2447
2500
|
constructor(rest) {
|
|
2448
2501
|
this.rest = rest;
|
|
2449
2502
|
}
|
|
2503
|
+
rest;
|
|
2450
2504
|
static {
|
|
2451
2505
|
__name(this, "RoleConnectionsAPI");
|
|
2452
2506
|
}
|
|
@@ -2484,6 +2538,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2484
2538
|
constructor(rest) {
|
|
2485
2539
|
this.rest = rest;
|
|
2486
2540
|
}
|
|
2541
|
+
rest;
|
|
2487
2542
|
static {
|
|
2488
2543
|
__name(this, "SoundboardSoundsAPI");
|
|
2489
2544
|
}
|
|
@@ -2508,6 +2563,7 @@ var StageInstancesAPI = class {
|
|
|
2508
2563
|
constructor(rest) {
|
|
2509
2564
|
this.rest = rest;
|
|
2510
2565
|
}
|
|
2566
|
+
rest;
|
|
2511
2567
|
static {
|
|
2512
2568
|
__name(this, "StageInstancesAPI");
|
|
2513
2569
|
}
|
|
@@ -2570,6 +2626,7 @@ var StickersAPI = class {
|
|
|
2570
2626
|
constructor(rest) {
|
|
2571
2627
|
this.rest = rest;
|
|
2572
2628
|
}
|
|
2629
|
+
rest;
|
|
2573
2630
|
static {
|
|
2574
2631
|
__name(this, "StickersAPI");
|
|
2575
2632
|
}
|
|
@@ -2622,6 +2679,7 @@ var ThreadsAPI = class {
|
|
|
2622
2679
|
constructor(rest) {
|
|
2623
2680
|
this.rest = rest;
|
|
2624
2681
|
}
|
|
2682
|
+
rest;
|
|
2625
2683
|
static {
|
|
2626
2684
|
__name(this, "ThreadsAPI");
|
|
2627
2685
|
}
|
|
@@ -2699,6 +2757,7 @@ var UsersAPI = class {
|
|
|
2699
2757
|
constructor(rest) {
|
|
2700
2758
|
this.rest = rest;
|
|
2701
2759
|
}
|
|
2760
|
+
rest;
|
|
2702
2761
|
static {
|
|
2703
2762
|
__name(this, "UsersAPI");
|
|
2704
2763
|
}
|
|
@@ -2838,6 +2897,7 @@ var WebhooksAPI = class {
|
|
|
2838
2897
|
constructor(rest) {
|
|
2839
2898
|
this.rest = rest;
|
|
2840
2899
|
}
|
|
2900
|
+
rest;
|
|
2841
2901
|
static {
|
|
2842
2902
|
__name(this, "WebhooksAPI");
|
|
2843
2903
|
}
|
|
@@ -3020,6 +3080,7 @@ var API = class {
|
|
|
3020
3080
|
this.webhooks = new WebhooksAPI(rest);
|
|
3021
3081
|
this.interactions = new InteractionsAPI(rest, this.webhooks);
|
|
3022
3082
|
}
|
|
3083
|
+
rest;
|
|
3023
3084
|
static {
|
|
3024
3085
|
__name(this, "API");
|
|
3025
3086
|
}
|
|
@@ -3062,7 +3123,7 @@ __name(withFiles, "withFiles");
|
|
|
3062
3123
|
|
|
3063
3124
|
// src/http-only/index.ts
|
|
3064
3125
|
export * from "discord-api-types/v10";
|
|
3065
|
-
var version = "2.
|
|
3126
|
+
var version = "2.6.0";
|
|
3066
3127
|
export {
|
|
3067
3128
|
API,
|
|
3068
3129
|
ApplicationCommandsAPI,
|