@discordjs/core 2.1.1 → 2.2.1
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/http-only.d.mts +10 -11
- package/dist/http-only.d.ts +10 -11
- package/dist/http-only.js +25 -13
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +25 -13
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +10 -11
- package/dist/index.d.ts +10 -11
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/http-only.mjs
CHANGED
|
@@ -470,8 +470,12 @@ var ChannelsAPI = class {
|
|
|
470
470
|
* @param body - The new channel data
|
|
471
471
|
* @param options - The options for editing the channel
|
|
472
472
|
*/
|
|
473
|
-
async edit(channelId, body, { signal } = {}) {
|
|
474
|
-
return this.rest.patch(Routes3.channel(channelId), {
|
|
473
|
+
async edit(channelId, body, { signal, reason } = {}) {
|
|
474
|
+
return this.rest.patch(Routes3.channel(channelId), {
|
|
475
|
+
reason,
|
|
476
|
+
body,
|
|
477
|
+
signal
|
|
478
|
+
});
|
|
475
479
|
}
|
|
476
480
|
/**
|
|
477
481
|
* Deletes a channel
|
|
@@ -480,8 +484,8 @@ var ChannelsAPI = class {
|
|
|
480
484
|
* @param channelId - The id of the channel to delete
|
|
481
485
|
* @param options - The options for deleting the channel
|
|
482
486
|
*/
|
|
483
|
-
async delete(channelId, { signal } = {}) {
|
|
484
|
-
return this.rest.delete(Routes3.channel(channelId), { signal });
|
|
487
|
+
async delete(channelId, { signal, reason } = {}) {
|
|
488
|
+
return this.rest.delete(Routes3.channel(channelId), { signal, reason });
|
|
485
489
|
}
|
|
486
490
|
/**
|
|
487
491
|
* Fetches the messages of a channel
|
|
@@ -637,10 +641,11 @@ var ChannelsAPI = class {
|
|
|
637
641
|
* @param messageId - The id of the message to start the thread from
|
|
638
642
|
* @param options - The options for starting the thread
|
|
639
643
|
*/
|
|
640
|
-
async createThread(channelId, body, messageId, { signal } = {}) {
|
|
644
|
+
async createThread(channelId, body, messageId, { signal, reason } = {}) {
|
|
641
645
|
return this.rest.post(Routes3.threads(channelId, messageId), {
|
|
642
646
|
body,
|
|
643
|
-
signal
|
|
647
|
+
signal,
|
|
648
|
+
reason
|
|
644
649
|
});
|
|
645
650
|
}
|
|
646
651
|
/**
|
|
@@ -651,13 +656,18 @@ var ChannelsAPI = class {
|
|
|
651
656
|
* @param body - The data for starting the thread
|
|
652
657
|
* @param options - The options for starting the thread
|
|
653
658
|
*/
|
|
654
|
-
async createForumThread(channelId, { message, ...optionsBody }, { signal } = {}) {
|
|
659
|
+
async createForumThread(channelId, { message, ...optionsBody }, { signal, reason } = {}) {
|
|
655
660
|
const { files, ...messageBody } = message;
|
|
656
661
|
const body = {
|
|
657
662
|
...optionsBody,
|
|
658
663
|
message: messageBody
|
|
659
664
|
};
|
|
660
|
-
return this.rest.post(Routes3.threads(channelId), {
|
|
665
|
+
return this.rest.post(Routes3.threads(channelId), {
|
|
666
|
+
files,
|
|
667
|
+
body,
|
|
668
|
+
reason,
|
|
669
|
+
signal
|
|
670
|
+
});
|
|
661
671
|
}
|
|
662
672
|
/**
|
|
663
673
|
* Fetches the archived threads of a channel
|
|
@@ -886,8 +896,8 @@ var GuildsAPI = class {
|
|
|
886
896
|
* @param guildId - The id of the guild to delete
|
|
887
897
|
* @param options - The options for deleting this guild
|
|
888
898
|
*/
|
|
889
|
-
async delete(guildId, { signal
|
|
890
|
-
await this.rest.delete(Routes5.guild(guildId), {
|
|
899
|
+
async delete(guildId, { signal } = {}) {
|
|
900
|
+
await this.rest.delete(Routes5.guild(guildId), { signal });
|
|
891
901
|
}
|
|
892
902
|
/**
|
|
893
903
|
* Adds user to the guild
|
|
@@ -2697,11 +2707,12 @@ var WebhooksAPI = class {
|
|
|
2697
2707
|
async execute(id, token, {
|
|
2698
2708
|
wait,
|
|
2699
2709
|
thread_id,
|
|
2710
|
+
with_components,
|
|
2700
2711
|
files,
|
|
2701
2712
|
...body
|
|
2702
2713
|
}, { signal } = {}) {
|
|
2703
2714
|
return this.rest.post(Routes16.webhook(id, token), {
|
|
2704
|
-
query: makeURLSearchParams9({ wait, thread_id }),
|
|
2715
|
+
query: makeURLSearchParams9({ wait, thread_id, with_components }),
|
|
2705
2716
|
files,
|
|
2706
2717
|
body,
|
|
2707
2718
|
auth: false,
|
|
@@ -2774,11 +2785,12 @@ var WebhooksAPI = class {
|
|
|
2774
2785
|
*/
|
|
2775
2786
|
async editMessage(id, token, messageId, {
|
|
2776
2787
|
thread_id,
|
|
2788
|
+
with_components,
|
|
2777
2789
|
files,
|
|
2778
2790
|
...body
|
|
2779
2791
|
}, { signal } = {}) {
|
|
2780
2792
|
return this.rest.patch(Routes16.webhookMessage(id, token, messageId), {
|
|
2781
|
-
query: makeURLSearchParams9({ thread_id }),
|
|
2793
|
+
query: makeURLSearchParams9({ thread_id, with_components }),
|
|
2782
2794
|
auth: false,
|
|
2783
2795
|
body,
|
|
2784
2796
|
signal,
|
|
@@ -2865,7 +2877,7 @@ __name(withFiles, "withFiles");
|
|
|
2865
2877
|
|
|
2866
2878
|
// src/http-only/index.ts
|
|
2867
2879
|
export * from "discord-api-types/v10";
|
|
2868
|
-
var version = "2.
|
|
2880
|
+
var version = "2.2.1";
|
|
2869
2881
|
export {
|
|
2870
2882
|
API,
|
|
2871
2883
|
ApplicationCommandsAPI,
|