Skip to content

Commit e6370ae

Browse files
authored
chore: remove container limit (#10867)
* chore: remove container limit * fix: typo * fix: setValidationEnabled
1 parent f8d7b1c commit e6370ae

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/builders/src/components/v2/Assertions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function assertReturnOfBuilder<ReturnType extends MediaGalleryItemBuilder
5757
input: unknown,
5858
ExpectedInstanceOf: new () => ReturnType,
5959
): asserts input is ReturnType {
60-
s.instance(ExpectedInstanceOf).parse(input);
60+
s.instance(ExpectedInstanceOf).setValidationEnabled(isValidationEnabled).parse(input);
6161
}
6262

6363
export function validateComponentArray<
@@ -67,5 +67,6 @@ export function validateComponentArray<
6767
.array()
6868
.lengthGreaterThanOrEqual(min)
6969
.lengthLessThanOrEqual(max)
70+
.setValidationEnabled(isValidationEnabled)
7071
.parse(input);
7172
}

packages/builders/src/components/v2/Container.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type { AnyComponentBuilder, MessageActionRowComponentBuilder } from '../A
1919
import { ActionRowBuilder } from '../ActionRow.js';
2020
import { ComponentBuilder } from '../Component.js';
2121
import { createComponentBuilder, resolveBuilder } from '../Components.js';
22-
import { containerColorPredicate, spoilerPredicate, validateComponentArray } from './Assertions.js';
22+
import { containerColorPredicate, spoilerPredicate } from './Assertions.js';
2323
import { FileBuilder } from './File.js';
2424
import { SeparatorBuilder } from './Separator.js';
2525
import { TextDisplayBuilder } from './TextDisplay.js';
@@ -231,7 +231,6 @@ export class ContainerBuilder extends ComponentBuilder<APIContainerComponent> {
231231
* {@inheritDoc ComponentBuilder.toJSON}
232232
*/
233233
public toJSON(): APIContainerComponent {
234-
validateComponentArray(this.components, 1, 10);
235234
return {
236235
...this.data,
237236
components: this.components.map((component) => component.toJSON()),

packages/builders/src/components/v2/Thumbnail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent> {
1111
* @example
1212
* Creating a thumbnail from an API data object:
1313
* ```ts
14-
* const thumbnaik = new ThumbnailBuilder({
14+
* const thumbnail = new ThumbnailBuilder({
1515
* description: 'some text',
1616
* media: {
1717
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',

0 commit comments

Comments
 (0)