1- /* eslint-disable jsdoc/check-param-names */
2-
31import type {
42 APITextInputComponent ,
53 APIActionRowComponent ,
@@ -43,10 +41,11 @@ export interface ActionRowBuilderData
4341
4442/**
4543 * A builder that creates API-compatible JSON data for action rows.
46- *
47- * @typeParam ComponentType - The types of components this action row holds
4844 */
4945export class ActionRowBuilder extends ComponentBuilder < APIActionRowComponent < APIComponentInActionRow > > {
46+ /**
47+ * @internal
48+ */
5049 protected readonly data : ActionRowBuilderData ;
5150
5251 /**
@@ -57,7 +56,7 @@ export class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<API
5756 }
5857
5958 /**
60- * Creates a new action row from API data .
59+ * Creates a new action row.
6160 *
6261 * @param data - The API data to create this action row with
6362 * @example
@@ -90,12 +89,15 @@ export class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<API
9089 * .addComponents(button2, button3);
9190 * ```
9291 */
93- public constructor ( { components = [ ] , ... data } : Partial < APIActionRowComponent < APIComponentInActionRow > > = { } ) {
92+ public constructor ( data : Partial < APIActionRowComponent < APIComponentInActionRow > > = { } ) {
9493 super ( ) ;
94+
95+ const { components = [ ] , ...rest } = data ;
96+
9597 this . data = {
96- ...structuredClone ( data ) ,
97- type : ComponentType . ActionRow ,
98+ ...structuredClone ( rest ) ,
9899 components : components . map ( ( component ) => createComponentBuilder ( component ) ) ,
100+ type : ComponentType . ActionRow ,
99101 } ;
100102 }
101103
0 commit comments