@discordjs/core 2.2.0 → 2.2.2

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.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), { body, signal });
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), { files, body, signal });
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
@@ -860,6 +870,7 @@ var GuildsAPI = class {
860
870
  * @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
861
871
  * @param body - The guild to create
862
872
  * @param options - The options for creating the guild
873
+ * @deprecated API related to guild ownership may no longer be used.
863
874
  */
864
875
  async create(body, { signal } = {}) {
865
876
  return this.rest.post(Routes5.guilds(), { body, signal });
@@ -885,9 +896,10 @@ var GuildsAPI = class {
885
896
  * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
886
897
  * @param guildId - The id of the guild to delete
887
898
  * @param options - The options for deleting this guild
899
+ * @deprecated API related to guild ownership may no longer be used.
888
900
  */
889
- async delete(guildId, { signal, reason } = {}) {
890
- await this.rest.delete(Routes5.guild(guildId), { reason, signal });
901
+ async delete(guildId, { signal } = {}) {
902
+ await this.rest.delete(Routes5.guild(guildId), { signal });
891
903
  }
892
904
  /**
893
905
  * Adds user to the guild
@@ -1110,6 +1122,7 @@ var GuildsAPI = class {
1110
1122
  * @param guildId - The id of the guild to edit the MFA level for
1111
1123
  * @param level - The new MFA level
1112
1124
  * @param options - The options for editing the MFA level
1125
+ * @deprecated API related to guild ownership may no longer be used.
1113
1126
  */
1114
1127
  async editMFALevel(guildId, level, { reason, signal } = {}) {
1115
1128
  return this.rest.post(Routes5.guildMFA(guildId), {
@@ -1722,12 +1735,12 @@ var GuildsAPI = class {
1722
1735
  * Creates a new template
1723
1736
  *
1724
1737
  * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
1725
- * @param templateCode - The code of the template
1738
+ * @param guildId - The id of the guild
1726
1739
  * @param body - The data for creating the template
1727
1740
  * @param options - The options for creating the template
1728
1741
  */
1729
- async createTemplate(templateCode, body, { signal } = {}) {
1730
- return this.rest.post(Routes5.template(templateCode), { body, signal });
1742
+ async createTemplate(guildId, body, { signal } = {}) {
1743
+ return this.rest.post(Routes5.guildTemplates(guildId), { body, signal });
1731
1744
  }
1732
1745
  /**
1733
1746
  * Fetches webhooks for a guild
@@ -3016,7 +3029,7 @@ __name(withFiles, "withFiles");
3016
3029
 
3017
3030
  // src/index.ts
3018
3031
  export * from "discord-api-types/v10";
3019
- var version = "2.2.0";
3032
+ var version = "2.2.2";
3020
3033
  export {
3021
3034
  API,
3022
3035
  ApplicationCommandsAPI,