@discordjs/builders 0.14.0-dev.1650413406-585169f → 0.14.0-dev.1650931748-df64d3e
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.ts +12 -12
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ declare class UnsafeEmbedBuilder {
|
|
|
110
110
|
*
|
|
111
111
|
* @param fields The fields to add
|
|
112
112
|
*/
|
|
113
|
-
addFields(
|
|
113
|
+
addFields(fields: APIEmbedField[]): this;
|
|
114
114
|
/**
|
|
115
115
|
* Removes, replaces, or inserts fields in the embed (max 25)
|
|
116
116
|
*
|
|
@@ -123,7 +123,7 @@ declare class UnsafeEmbedBuilder {
|
|
|
123
123
|
* Sets the embed's fields (max 25).
|
|
124
124
|
* @param fields The fields to set
|
|
125
125
|
*/
|
|
126
|
-
setFields(
|
|
126
|
+
setFields(fields: APIEmbedField[]): this;
|
|
127
127
|
/**
|
|
128
128
|
* Sets the author of this embed
|
|
129
129
|
*
|
|
@@ -188,7 +188,7 @@ declare class UnsafeEmbedBuilder {
|
|
|
188
188
|
* Represents a validated embed in a message (image/video preview, rich embed, etc.)
|
|
189
189
|
*/
|
|
190
190
|
declare class EmbedBuilder extends UnsafeEmbedBuilder {
|
|
191
|
-
addFields(
|
|
191
|
+
addFields(fields: APIEmbedField[]): this;
|
|
192
192
|
spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
|
|
193
193
|
setAuthor(options: EmbedAuthorOptions | null): this;
|
|
194
194
|
setColor(color: number | RGBTuple | null): this;
|
|
@@ -584,12 +584,12 @@ declare class ActionRowBuilder<T extends AnyComponentBuilder> extends ComponentB
|
|
|
584
584
|
* @param components The components to add to this action row.
|
|
585
585
|
* @returns
|
|
586
586
|
*/
|
|
587
|
-
addComponents(
|
|
587
|
+
addComponents(components: T[]): this;
|
|
588
588
|
/**
|
|
589
589
|
* Sets the components in this action row
|
|
590
590
|
* @param components The components to set this row to
|
|
591
591
|
*/
|
|
592
|
-
setComponents(
|
|
592
|
+
setComponents(components: T[]): this;
|
|
593
593
|
toJSON(): APIActionRowComponent<ReturnType<T['toJSON']>>;
|
|
594
594
|
}
|
|
595
595
|
|
|
@@ -665,7 +665,7 @@ declare class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompon
|
|
|
665
665
|
});
|
|
666
666
|
/**
|
|
667
667
|
* Sets the custom id for this text input
|
|
668
|
-
* @param customId The custom id of this text
|
|
668
|
+
* @param customId The custom id of this text input
|
|
669
669
|
*/
|
|
670
670
|
setCustomId(customId: string): this;
|
|
671
671
|
/**
|
|
@@ -763,12 +763,12 @@ declare class UnsafeModalBuilder implements JSONEncodable<APIModalInteractionRes
|
|
|
763
763
|
* Adds components to this modal
|
|
764
764
|
* @param components The components to add to this modal
|
|
765
765
|
*/
|
|
766
|
-
addComponents(
|
|
766
|
+
addComponents(components: (ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>)[]): this;
|
|
767
767
|
/**
|
|
768
768
|
* Sets the components in this modal
|
|
769
769
|
* @param components The components to set this modal to
|
|
770
770
|
*/
|
|
771
|
-
setComponents(
|
|
771
|
+
setComponents(components: ActionRowBuilder<ModalActionRowComponentBuilder>[]): this;
|
|
772
772
|
toJSON(): APIModalInteractionResponseCallbackData;
|
|
773
773
|
}
|
|
774
774
|
|
|
@@ -831,12 +831,12 @@ declare class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuComp
|
|
|
831
831
|
* @param options The options to add to this select menu
|
|
832
832
|
* @returns
|
|
833
833
|
*/
|
|
834
|
-
addOptions(
|
|
834
|
+
addOptions(options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]): this;
|
|
835
835
|
/**
|
|
836
836
|
* Sets the options on this select menu
|
|
837
837
|
* @param options The options to set on this select menu
|
|
838
838
|
*/
|
|
839
|
-
setOptions(
|
|
839
|
+
setOptions(options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]): this;
|
|
840
840
|
toJSON(): APISelectMenuComponent;
|
|
841
841
|
}
|
|
842
842
|
|
|
@@ -849,8 +849,8 @@ declare class SelectMenuBuilder extends UnsafeSelectMenuBuilder {
|
|
|
849
849
|
setMaxValues(maxValues: number): this;
|
|
850
850
|
setCustomId(customId: string): this;
|
|
851
851
|
setDisabled(disabled?: boolean): this;
|
|
852
|
-
addOptions(
|
|
853
|
-
setOptions(
|
|
852
|
+
addOptions(options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]): this;
|
|
853
|
+
setOptions(options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]): this;
|
|
854
854
|
toJSON(): APISelectMenuComponent;
|
|
855
855
|
}
|
|
856
856
|
|
package/dist/index.js
CHANGED
|
@@ -164,7 +164,7 @@ var UnsafeEmbedBuilder = class {
|
|
|
164
164
|
if (data.timestamp)
|
|
165
165
|
this.data.timestamp = new Date(data.timestamp).toISOString();
|
|
166
166
|
}
|
|
167
|
-
addFields(
|
|
167
|
+
addFields(fields) {
|
|
168
168
|
if (this.data.fields)
|
|
169
169
|
this.data.fields.push(...fields);
|
|
170
170
|
else
|
|
@@ -178,7 +178,7 @@ var UnsafeEmbedBuilder = class {
|
|
|
178
178
|
this.data.fields = fields;
|
|
179
179
|
return this;
|
|
180
180
|
}
|
|
181
|
-
setFields(
|
|
181
|
+
setFields(fields) {
|
|
182
182
|
this.spliceFields(0, this.data.fields?.length ?? 0, ...fields);
|
|
183
183
|
return this;
|
|
184
184
|
}
|
|
@@ -239,9 +239,9 @@ __name(UnsafeEmbedBuilder, "UnsafeEmbedBuilder");
|
|
|
239
239
|
|
|
240
240
|
// src/messages/embed/Embed.ts
|
|
241
241
|
var EmbedBuilder = class extends UnsafeEmbedBuilder {
|
|
242
|
-
addFields(
|
|
242
|
+
addFields(fields) {
|
|
243
243
|
validateFieldLength(fields.length, this.data.fields);
|
|
244
|
-
return super.addFields(
|
|
244
|
+
return super.addFields(embedFieldsArrayPredicate.parse(fields));
|
|
245
245
|
}
|
|
246
246
|
spliceFields(index, deleteCount, ...fields) {
|
|
247
247
|
validateFieldLength(fields.length - deleteCount, this.data.fields);
|
|
@@ -522,11 +522,11 @@ var ActionRowBuilder = class extends ComponentBuilder {
|
|
|
522
522
|
__publicField(this, "components");
|
|
523
523
|
this.components = components?.map((c) => createComponentBuilder(c)) ?? [];
|
|
524
524
|
}
|
|
525
|
-
addComponents(
|
|
525
|
+
addComponents(components) {
|
|
526
526
|
this.components.push(...components);
|
|
527
527
|
return this;
|
|
528
528
|
}
|
|
529
|
-
setComponents(
|
|
529
|
+
setComponents(components) {
|
|
530
530
|
this.components.splice(0, this.components.length, ...components);
|
|
531
531
|
return this;
|
|
532
532
|
}
|
|
@@ -725,11 +725,11 @@ var UnsafeModalBuilder = class {
|
|
|
725
725
|
this.data.custom_id = customId;
|
|
726
726
|
return this;
|
|
727
727
|
}
|
|
728
|
-
addComponents(
|
|
728
|
+
addComponents(components) {
|
|
729
729
|
this.components.push(...components.map((component) => component instanceof ActionRowBuilder ? component : new ActionRowBuilder(component)));
|
|
730
730
|
return this;
|
|
731
731
|
}
|
|
732
|
-
setComponents(
|
|
732
|
+
setComponents(components) {
|
|
733
733
|
this.components.splice(0, this.components.length, ...components);
|
|
734
734
|
return this;
|
|
735
735
|
}
|
|
@@ -803,11 +803,11 @@ var UnsafeSelectMenuBuilder = class extends ComponentBuilder {
|
|
|
803
803
|
this.data.disabled = disabled;
|
|
804
804
|
return this;
|
|
805
805
|
}
|
|
806
|
-
addOptions(
|
|
806
|
+
addOptions(options) {
|
|
807
807
|
this.options.push(...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(option)));
|
|
808
808
|
return this;
|
|
809
809
|
}
|
|
810
|
-
setOptions(
|
|
810
|
+
setOptions(options) {
|
|
811
811
|
this.options.splice(0, this.options.length, ...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(option)));
|
|
812
812
|
return this;
|
|
813
813
|
}
|
|
@@ -837,12 +837,12 @@ var SelectMenuBuilder = class extends UnsafeSelectMenuBuilder {
|
|
|
837
837
|
setDisabled(disabled = true) {
|
|
838
838
|
return super.setDisabled(disabledValidator.parse(disabled));
|
|
839
839
|
}
|
|
840
|
-
addOptions(
|
|
840
|
+
addOptions(options) {
|
|
841
841
|
optionsLengthValidator.parse(this.options.length + options.length);
|
|
842
842
|
this.options.push(...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(optionValidator.parse(option))));
|
|
843
843
|
return this;
|
|
844
844
|
}
|
|
845
|
-
setOptions(
|
|
845
|
+
setOptions(options) {
|
|
846
846
|
optionsLengthValidator.parse(options.length);
|
|
847
847
|
this.options.splice(0, this.options.length, ...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(optionValidator.parse(option))));
|
|
848
848
|
return this;
|