fix: don't create new instances of builders classes (#7343)

This commit is contained in:
Rodry
2022-01-26 09:23:58 +00:00
committed by GitHub
parent b6402723c3
commit d6b56d0080
2 changed files with 10 additions and 7 deletions

View File

@@ -3,6 +3,8 @@ import type { ButtonComponent, SelectMenuComponent } from '..';
import type { Component } from './Component';
import { createComponent } from './Components';
export type MessageComponent = ActionRowComponent | ActionRow;
export type ActionRowComponent = ButtonComponent | SelectMenuComponent;
// TODO: Add valid form component types
@@ -10,7 +12,7 @@ export type ActionRowComponent = ButtonComponent | SelectMenuComponent;
/**
* Represents an action row component
*/
export class ActionRow<T extends ActionRowComponent> implements Component {
export class ActionRow<T extends ActionRowComponent = ActionRowComponent> implements Component {
public readonly components: T[] = [];
public readonly type = ComponentType.ActionRow;