@discordjs/builders 2.0.0-dev.1765065716-5e6bd4b3d → 2.0.0-dev.1765238522-f38395ec4

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
@@ -4276,6 +4276,11 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
4276
4276
  * Creates a new attachment builder.
4277
4277
  *
4278
4278
  * @param data - The API data to create this attachment with
4279
+ * @example
4280
+ * ```ts
4281
+ * const attachment = new AttachmentBuilder().setId(1).setFileData(':)').setFilename('smiley.txt')
4282
+ * ```
4283
+ * @remarks Please note that the `id` field is required, it's rather easy to miss!
4279
4284
  */
4280
4285
  constructor(data?: Partial<RESTAPIAttachment>);
4281
4286
  /**
@@ -4561,7 +4566,7 @@ declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJ
4561
4566
  *
4562
4567
  * @param allowedMentions - The allowed mentions to set
4563
4568
  */
4564
- setAllowedMentions(allowedMentions: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)): this;
4569
+ setAllowedMentions(allowedMentions?: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)): this;
4565
4570
  /**
4566
4571
  * Updates the allowed mentions for this message (and creates it if it doesn't exist)
4567
4572
  *
package/dist/index.d.ts CHANGED
@@ -4276,6 +4276,11 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
4276
4276
  * Creates a new attachment builder.
4277
4277
  *
4278
4278
  * @param data - The API data to create this attachment with
4279
+ * @example
4280
+ * ```ts
4281
+ * const attachment = new AttachmentBuilder().setId(1).setFileData(':)').setFilename('smiley.txt')
4282
+ * ```
4283
+ * @remarks Please note that the `id` field is required, it's rather easy to miss!
4279
4284
  */
4280
4285
  constructor(data?: Partial<RESTAPIAttachment>);
4281
4286
  /**
@@ -4561,7 +4566,7 @@ declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJ
4561
4566
  *
4562
4567
  * @param allowedMentions - The allowed mentions to set
4563
4568
  */
4564
- setAllowedMentions(allowedMentions: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)): this;
4569
+ setAllowedMentions(allowedMentions?: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)): this;
4565
4570
  /**
4566
4571
  * Updates the allowed mentions for this message (and creates it if it doesn't exist)
4567
4572
  *
package/dist/index.js CHANGED
@@ -5086,6 +5086,11 @@ var AttachmentBuilder = class {
5086
5086
  * Creates a new attachment builder.
5087
5087
  *
5088
5088
  * @param data - The API data to create this attachment with
5089
+ * @example
5090
+ * ```ts
5091
+ * const attachment = new AttachmentBuilder().setId(1).setFileData(':)').setFilename('smiley.txt')
5092
+ * ```
5093
+ * @remarks Please note that the `id` field is required, it's rather easy to miss!
5089
5094
  */
5090
5095
  constructor(data = {}) {
5091
5096
  this.data = structuredClone(data);
@@ -5193,7 +5198,7 @@ var AttachmentBuilder = class {
5193
5198
  return {
5194
5199
  ...this.fileData,
5195
5200
  name: this.data.filename,
5196
- key: this.data.id ? `files[${this.data.id}]` : void 0
5201
+ key: this.data.id === void 0 ? void 0 : `files[${this.data.id}]`
5197
5202
  };
5198
5203
  }
5199
5204
  /**
@@ -5500,7 +5505,7 @@ var MessageBuilder = class {
5500
5505
  *
5501
5506
  * @param allowedMentions - The allowed mentions to set
5502
5507
  */
5503
- setAllowedMentions(allowedMentions) {
5508
+ setAllowedMentions(allowedMentions = new AllowedMentionsBuilder()) {
5504
5509
  this.data.allowed_mentions = resolveBuilder(allowedMentions, AllowedMentionsBuilder);
5505
5510
  return this;
5506
5511
  }
@@ -5857,7 +5862,7 @@ var MessageBuilder = class {
5857
5862
  };
5858
5863
 
5859
5864
  // src/index.ts
5860
- var version = "2.0.0-dev.1765065716-5e6bd4b3d";
5865
+ var version = "2.0.0-dev.1765238522-f38395ec4";
5861
5866
  // Annotate the CommonJS export names for ESM import in node:
5862
5867
  0 && (module.exports = {
5863
5868
  ActionRowBuilder,