@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/index.d.mts CHANGED
@@ -193,7 +193,7 @@ declare class ApplicationsAPI {
193
193
  * @param emojiId - The id of the emoji to fetch
194
194
  * @param options - The options for fetching the emoji
195
195
  */
196
- getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIEmoji>;
196
+ getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
197
197
  /**
198
198
  * Creates a new emoji of an application
199
199
  *
@@ -202,7 +202,7 @@ declare class ApplicationsAPI {
202
202
  * @param body - The data for creating the emoji
203
203
  * @param options - The options for creating the emoji
204
204
  */
205
- createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIEmoji>;
205
+ createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
206
206
  /**
207
207
  * Edits an emoji of an application
208
208
  *
@@ -212,7 +212,7 @@ declare class ApplicationsAPI {
212
212
  * @param body - The data for editing the emoji
213
213
  * @param options - The options for editing the emoji
214
214
  */
215
- editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIEmoji>;
215
+ editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
216
216
  /**
217
217
  * Deletes an emoji of an application
218
218
  *
@@ -332,7 +332,7 @@ declare class ChannelsAPI {
332
332
  * @param body - The new channel data
333
333
  * @param options - The options for editing the channel
334
334
  */
335
- edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
335
+ edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
336
336
  /**
337
337
  * Deletes a channel
338
338
  *
@@ -340,7 +340,7 @@ declare class ChannelsAPI {
340
340
  * @param channelId - The id of the channel to delete
341
341
  * @param options - The options for deleting the channel
342
342
  */
343
- delete(channelId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
343
+ delete(channelId: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
344
344
  /**
345
345
  * Fetches the messages of a channel
346
346
  *
@@ -456,7 +456,7 @@ declare class ChannelsAPI {
456
456
  * @param messageId - The id of the message to start the thread from
457
457
  * @param options - The options for starting the thread
458
458
  */
459
- createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
459
+ createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
460
460
  /**
461
461
  * Creates a new forum post
462
462
  *
@@ -465,7 +465,7 @@ declare class ChannelsAPI {
465
465
  * @param body - The data for starting the thread
466
466
  * @param options - The options for starting the thread
467
467
  */
468
- createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<APIThreadChannel>;
468
+ createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<APIThreadChannel<discord_api_types_v10.ThreadChannelType>>;
469
469
  /**
470
470
  * Fetches the archived threads of a channel
471
471
  *
@@ -576,7 +576,7 @@ declare class GuildsAPI {
576
576
  * @param guildId - The id of the guild to delete
577
577
  * @param options - The options for deleting this guild
578
578
  */
579
- delete(guildId: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<void>;
579
+ delete(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
580
580
  /**
581
581
  * Adds user to the guild
582
582
  *
package/dist/index.d.ts CHANGED
@@ -193,7 +193,7 @@ declare class ApplicationsAPI {
193
193
  * @param emojiId - The id of the emoji to fetch
194
194
  * @param options - The options for fetching the emoji
195
195
  */
196
- getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIEmoji>;
196
+ getEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
197
197
  /**
198
198
  * Creates a new emoji of an application
199
199
  *
@@ -202,7 +202,7 @@ declare class ApplicationsAPI {
202
202
  * @param body - The data for creating the emoji
203
203
  * @param options - The options for creating the emoji
204
204
  */
205
- createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIEmoji>;
205
+ createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
206
206
  /**
207
207
  * Edits an emoji of an application
208
208
  *
@@ -212,7 +212,7 @@ declare class ApplicationsAPI {
212
212
  * @param body - The data for editing the emoji
213
213
  * @param options - The options for editing the emoji
214
214
  */
215
- editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIEmoji>;
215
+ editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplicationEmoji>;
216
216
  /**
217
217
  * Deletes an emoji of an application
218
218
  *
@@ -332,7 +332,7 @@ declare class ChannelsAPI {
332
332
  * @param body - The new channel data
333
333
  * @param options - The options for editing the channel
334
334
  */
335
- edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
335
+ edit(channelId: Snowflake, body: RESTPatchAPIChannelJSONBody, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
336
336
  /**
337
337
  * Deletes a channel
338
338
  *
@@ -340,7 +340,7 @@ declare class ChannelsAPI {
340
340
  * @param channelId - The id of the channel to delete
341
341
  * @param options - The options for deleting the channel
342
342
  */
343
- delete(channelId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
343
+ delete(channelId: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
344
344
  /**
345
345
  * Fetches the messages of a channel
346
346
  *
@@ -456,7 +456,7 @@ declare class ChannelsAPI {
456
456
  * @param messageId - The id of the message to start the thread from
457
457
  * @param options - The options for starting the thread
458
458
  */
459
- createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIChannel>;
459
+ createThread(channelId: Snowflake, body: RESTPostAPIChannelThreadsJSONBody, messageId?: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIChannel>;
460
460
  /**
461
461
  * Creates a new forum post
462
462
  *
@@ -465,7 +465,7 @@ declare class ChannelsAPI {
465
465
  * @param body - The data for starting the thread
466
466
  * @param options - The options for starting the thread
467
467
  */
468
- createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<APIThreadChannel>;
468
+ createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<APIThreadChannel<discord_api_types_v10.ThreadChannelType>>;
469
469
  /**
470
470
  * Fetches the archived threads of a channel
471
471
  *
@@ -576,7 +576,7 @@ declare class GuildsAPI {
576
576
  * @param guildId - The id of the guild to delete
577
577
  * @param options - The options for deleting this guild
578
578
  */
579
- delete(guildId: Snowflake, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<void>;
579
+ delete(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
580
580
  /**
581
581
  * Adds user to the guild
582
582
  *
package/dist/index.js CHANGED
@@ -508,8 +508,12 @@ var ChannelsAPI = class {
508
508
  * @param body - The new channel data
509
509
  * @param options - The options for editing the channel
510
510
  */
511
- async edit(channelId, body, { signal } = {}) {
512
- return this.rest.patch(import_v103.Routes.channel(channelId), { body, signal });
511
+ async edit(channelId, body, { signal, reason } = {}) {
512
+ return this.rest.patch(import_v103.Routes.channel(channelId), {
513
+ reason,
514
+ body,
515
+ signal
516
+ });
513
517
  }
514
518
  /**
515
519
  * Deletes a channel
@@ -518,8 +522,8 @@ var ChannelsAPI = class {
518
522
  * @param channelId - The id of the channel to delete
519
523
  * @param options - The options for deleting the channel
520
524
  */
521
- async delete(channelId, { signal } = {}) {
522
- return this.rest.delete(import_v103.Routes.channel(channelId), { signal });
525
+ async delete(channelId, { signal, reason } = {}) {
526
+ return this.rest.delete(import_v103.Routes.channel(channelId), { signal, reason });
523
527
  }
524
528
  /**
525
529
  * Fetches the messages of a channel
@@ -675,10 +679,11 @@ var ChannelsAPI = class {
675
679
  * @param messageId - The id of the message to start the thread from
676
680
  * @param options - The options for starting the thread
677
681
  */
678
- async createThread(channelId, body, messageId, { signal } = {}) {
682
+ async createThread(channelId, body, messageId, { signal, reason } = {}) {
679
683
  return this.rest.post(import_v103.Routes.threads(channelId, messageId), {
680
684
  body,
681
- signal
685
+ signal,
686
+ reason
682
687
  });
683
688
  }
684
689
  /**
@@ -689,13 +694,18 @@ var ChannelsAPI = class {
689
694
  * @param body - The data for starting the thread
690
695
  * @param options - The options for starting the thread
691
696
  */
692
- async createForumThread(channelId, { message, ...optionsBody }, { signal } = {}) {
697
+ async createForumThread(channelId, { message, ...optionsBody }, { signal, reason } = {}) {
693
698
  const { files, ...messageBody } = message;
694
699
  const body = {
695
700
  ...optionsBody,
696
701
  message: messageBody
697
702
  };
698
- return this.rest.post(import_v103.Routes.threads(channelId), { files, body, signal });
703
+ return this.rest.post(import_v103.Routes.threads(channelId), {
704
+ files,
705
+ body,
706
+ reason,
707
+ signal
708
+ });
699
709
  }
700
710
  /**
701
711
  * Fetches the archived threads of a channel
@@ -920,8 +930,8 @@ var GuildsAPI = class {
920
930
  * @param guildId - The id of the guild to delete
921
931
  * @param options - The options for deleting this guild
922
932
  */
923
- async delete(guildId, { signal, reason } = {}) {
924
- await this.rest.delete(import_v105.Routes.guild(guildId), { reason, signal });
933
+ async delete(guildId, { signal } = {}) {
934
+ await this.rest.delete(import_v105.Routes.guild(guildId), { signal });
925
935
  }
926
936
  /**
927
937
  * Adds user to the guild
@@ -3025,7 +3035,7 @@ __name(withFiles, "withFiles");
3025
3035
 
3026
3036
  // src/index.ts
3027
3037
  __reExport(src_exports, require("discord-api-types/v10"), module.exports);
3028
- var version = "2.2.0";
3038
+ var version = "2.2.1";
3029
3039
  // Annotate the CommonJS export names for ESM import in node:
3030
3040
  0 && (module.exports = {
3031
3041
  API,