@discordjs/core 2.2.0 → 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 +8 -8
- package/dist/http-only.d.ts +8 -8
- package/dist/http-only.js +21 -11
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +21 -11
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +21 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/http-only.d.mts
CHANGED
|
@@ -190,7 +190,7 @@ declare class ApplicationsAPI {
|
|
|
190
190
|
* @param emojiId - The id of the emoji to fetch
|
|
191
191
|
* @param options - The options for fetching the emoji
|
|
192
192
|
*/
|
|
193
|
-
getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.
|
|
193
|
+
getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
|
|
194
194
|
/**
|
|
195
195
|
* Creates a new emoji of an application
|
|
196
196
|
*
|
|
@@ -199,7 +199,7 @@ declare class ApplicationsAPI {
|
|
|
199
199
|
* @param body - The data for creating the emoji
|
|
200
200
|
* @param options - The options for creating the emoji
|
|
201
201
|
*/
|
|
202
|
-
createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.
|
|
202
|
+
createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
|
|
203
203
|
/**
|
|
204
204
|
* Edits an emoji of an application
|
|
205
205
|
*
|
|
@@ -209,7 +209,7 @@ declare class ApplicationsAPI {
|
|
|
209
209
|
* @param body - The data for editing the emoji
|
|
210
210
|
* @param options - The options for editing the emoji
|
|
211
211
|
*/
|
|
212
|
-
editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.
|
|
212
|
+
editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
|
|
213
213
|
/**
|
|
214
214
|
* Deletes an emoji of an application
|
|
215
215
|
*
|
|
@@ -329,7 +329,7 @@ declare class ChannelsAPI {
|
|
|
329
329
|
* @param body - The new channel data
|
|
330
330
|
* @param options - The options for editing the channel
|
|
331
331
|
*/
|
|
332
|
-
edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
332
|
+
edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
333
333
|
/**
|
|
334
334
|
* Deletes a channel
|
|
335
335
|
*
|
|
@@ -337,7 +337,7 @@ declare class ChannelsAPI {
|
|
|
337
337
|
* @param channelId - The id of the channel to delete
|
|
338
338
|
* @param options - The options for deleting the channel
|
|
339
339
|
*/
|
|
340
|
-
delete(channelId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
340
|
+
delete(channelId: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
341
341
|
/**
|
|
342
342
|
* Fetches the messages of a channel
|
|
343
343
|
*
|
|
@@ -453,7 +453,7 @@ declare class ChannelsAPI {
|
|
|
453
453
|
* @param messageId - The id of the message to start the thread from
|
|
454
454
|
* @param options - The options for starting the thread
|
|
455
455
|
*/
|
|
456
|
-
createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
456
|
+
createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
457
457
|
/**
|
|
458
458
|
* Creates a new forum post
|
|
459
459
|
*
|
|
@@ -462,7 +462,7 @@ declare class ChannelsAPI {
|
|
|
462
462
|
* @param body - The data for starting the thread
|
|
463
463
|
* @param options - The options for starting the thread
|
|
464
464
|
*/
|
|
465
|
-
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<APIThreadChannel
|
|
465
|
+
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<APIThreadChannel<discord_api_types_v10.ThreadChannelType>>;
|
|
466
466
|
/**
|
|
467
467
|
* Fetches the archived threads of a channel
|
|
468
468
|
*
|
|
@@ -573,7 +573,7 @@ declare class GuildsAPI {
|
|
|
573
573
|
* @param guildId - The id of the guild to delete
|
|
574
574
|
* @param options - The options for deleting this guild
|
|
575
575
|
*/
|
|
576
|
-
delete(guildId: Snowflake, { signal
|
|
576
|
+
delete(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
577
577
|
/**
|
|
578
578
|
* Adds user to the guild
|
|
579
579
|
*
|
package/dist/http-only.d.ts
CHANGED
|
@@ -190,7 +190,7 @@ declare class ApplicationsAPI {
|
|
|
190
190
|
* @param emojiId - The id of the emoji to fetch
|
|
191
191
|
* @param options - The options for fetching the emoji
|
|
192
192
|
*/
|
|
193
|
-
getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.
|
|
193
|
+
getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
|
|
194
194
|
/**
|
|
195
195
|
* Creates a new emoji of an application
|
|
196
196
|
*
|
|
@@ -199,7 +199,7 @@ declare class ApplicationsAPI {
|
|
|
199
199
|
* @param body - The data for creating the emoji
|
|
200
200
|
* @param options - The options for creating the emoji
|
|
201
201
|
*/
|
|
202
|
-
createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.
|
|
202
|
+
createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
|
|
203
203
|
/**
|
|
204
204
|
* Edits an emoji of an application
|
|
205
205
|
*
|
|
@@ -209,7 +209,7 @@ declare class ApplicationsAPI {
|
|
|
209
209
|
* @param body - The data for editing the emoji
|
|
210
210
|
* @param options - The options for editing the emoji
|
|
211
211
|
*/
|
|
212
|
-
editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.
|
|
212
|
+
editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
|
|
213
213
|
/**
|
|
214
214
|
* Deletes an emoji of an application
|
|
215
215
|
*
|
|
@@ -329,7 +329,7 @@ declare class ChannelsAPI {
|
|
|
329
329
|
* @param body - The new channel data
|
|
330
330
|
* @param options - The options for editing the channel
|
|
331
331
|
*/
|
|
332
|
-
edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
332
|
+
edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
333
333
|
/**
|
|
334
334
|
* Deletes a channel
|
|
335
335
|
*
|
|
@@ -337,7 +337,7 @@ declare class ChannelsAPI {
|
|
|
337
337
|
* @param channelId - The id of the channel to delete
|
|
338
338
|
* @param options - The options for deleting the channel
|
|
339
339
|
*/
|
|
340
|
-
delete(channelId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
340
|
+
delete(channelId: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
341
341
|
/**
|
|
342
342
|
* Fetches the messages of a channel
|
|
343
343
|
*
|
|
@@ -453,7 +453,7 @@ declare class ChannelsAPI {
|
|
|
453
453
|
* @param messageId - The id of the message to start the thread from
|
|
454
454
|
* @param options - The options for starting the thread
|
|
455
455
|
*/
|
|
456
|
-
createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
456
|
+
createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
|
|
457
457
|
/**
|
|
458
458
|
* Creates a new forum post
|
|
459
459
|
*
|
|
@@ -462,7 +462,7 @@ declare class ChannelsAPI {
|
|
|
462
462
|
* @param body - The data for starting the thread
|
|
463
463
|
* @param options - The options for starting the thread
|
|
464
464
|
*/
|
|
465
|
-
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<APIThreadChannel
|
|
465
|
+
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<APIThreadChannel<discord_api_types_v10.ThreadChannelType>>;
|
|
466
466
|
/**
|
|
467
467
|
* Fetches the archived threads of a channel
|
|
468
468
|
*
|
|
@@ -573,7 +573,7 @@ declare class GuildsAPI {
|
|
|
573
573
|
* @param guildId - The id of the guild to delete
|
|
574
574
|
* @param options - The options for deleting this guild
|
|
575
575
|
*/
|
|
576
|
-
delete(guildId: Snowflake, { signal
|
|
576
|
+
delete(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
577
577
|
/**
|
|
578
578
|
* Adds user to the guild
|
|
579
579
|
*
|
package/dist/http-only.js
CHANGED
|
@@ -507,8 +507,12 @@ var ChannelsAPI = class {
|
|
|
507
507
|
* @param body - The new channel data
|
|
508
508
|
* @param options - The options for editing the channel
|
|
509
509
|
*/
|
|
510
|
-
async edit(channelId, body, { signal } = {}) {
|
|
511
|
-
return this.rest.patch(import_v103.Routes.channel(channelId), {
|
|
510
|
+
async edit(channelId, body, { signal, reason } = {}) {
|
|
511
|
+
return this.rest.patch(import_v103.Routes.channel(channelId), {
|
|
512
|
+
reason,
|
|
513
|
+
body,
|
|
514
|
+
signal
|
|
515
|
+
});
|
|
512
516
|
}
|
|
513
517
|
/**
|
|
514
518
|
* Deletes a channel
|
|
@@ -517,8 +521,8 @@ var ChannelsAPI = class {
|
|
|
517
521
|
* @param channelId - The id of the channel to delete
|
|
518
522
|
* @param options - The options for deleting the channel
|
|
519
523
|
*/
|
|
520
|
-
async delete(channelId, { signal } = {}) {
|
|
521
|
-
return this.rest.delete(import_v103.Routes.channel(channelId), { signal });
|
|
524
|
+
async delete(channelId, { signal, reason } = {}) {
|
|
525
|
+
return this.rest.delete(import_v103.Routes.channel(channelId), { signal, reason });
|
|
522
526
|
}
|
|
523
527
|
/**
|
|
524
528
|
* Fetches the messages of a channel
|
|
@@ -674,10 +678,11 @@ var ChannelsAPI = class {
|
|
|
674
678
|
* @param messageId - The id of the message to start the thread from
|
|
675
679
|
* @param options - The options for starting the thread
|
|
676
680
|
*/
|
|
677
|
-
async createThread(channelId, body, messageId, { signal } = {}) {
|
|
681
|
+
async createThread(channelId, body, messageId, { signal, reason } = {}) {
|
|
678
682
|
return this.rest.post(import_v103.Routes.threads(channelId, messageId), {
|
|
679
683
|
body,
|
|
680
|
-
signal
|
|
684
|
+
signal,
|
|
685
|
+
reason
|
|
681
686
|
});
|
|
682
687
|
}
|
|
683
688
|
/**
|
|
@@ -688,13 +693,18 @@ var ChannelsAPI = class {
|
|
|
688
693
|
* @param body - The data for starting the thread
|
|
689
694
|
* @param options - The options for starting the thread
|
|
690
695
|
*/
|
|
691
|
-
async createForumThread(channelId, { message, ...optionsBody }, { signal } = {}) {
|
|
696
|
+
async createForumThread(channelId, { message, ...optionsBody }, { signal, reason } = {}) {
|
|
692
697
|
const { files, ...messageBody } = message;
|
|
693
698
|
const body = {
|
|
694
699
|
...optionsBody,
|
|
695
700
|
message: messageBody
|
|
696
701
|
};
|
|
697
|
-
return this.rest.post(import_v103.Routes.threads(channelId), {
|
|
702
|
+
return this.rest.post(import_v103.Routes.threads(channelId), {
|
|
703
|
+
files,
|
|
704
|
+
body,
|
|
705
|
+
reason,
|
|
706
|
+
signal
|
|
707
|
+
});
|
|
698
708
|
}
|
|
699
709
|
/**
|
|
700
710
|
* Fetches the archived threads of a channel
|
|
@@ -919,8 +929,8 @@ var GuildsAPI = class {
|
|
|
919
929
|
* @param guildId - The id of the guild to delete
|
|
920
930
|
* @param options - The options for deleting this guild
|
|
921
931
|
*/
|
|
922
|
-
async delete(guildId, { signal
|
|
923
|
-
await this.rest.delete(import_v105.Routes.guild(guildId), {
|
|
932
|
+
async delete(guildId, { signal } = {}) {
|
|
933
|
+
await this.rest.delete(import_v105.Routes.guild(guildId), { signal });
|
|
924
934
|
}
|
|
925
935
|
/**
|
|
926
936
|
* Adds user to the guild
|
|
@@ -2878,7 +2888,7 @@ __name(withFiles, "withFiles");
|
|
|
2878
2888
|
|
|
2879
2889
|
// src/http-only/index.ts
|
|
2880
2890
|
__reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
|
|
2881
|
-
var version = "2.2.
|
|
2891
|
+
var version = "2.2.1";
|
|
2882
2892
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2883
2893
|
0 && (module.exports = {
|
|
2884
2894
|
API,
|