mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
types: fix regressions (#7649)
* types: fix regressions * fix: make requested changes * Apply suggestions from code review Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> * types: action row data should take builders * types: remove redundant overload * fix(MessagePayload): ensure components are serialized correctly * fix(MessagePayload): don't always create new action row * refactor(UnsafeModalBuilder): make data public * types: use type union Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> * types: fix types and add tests Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -34,7 +34,7 @@ export class ActionRowBuilder<
|
||||
/**
|
||||
* The components within this action row
|
||||
*/
|
||||
private readonly components: T[];
|
||||
public readonly components: T[];
|
||||
|
||||
public constructor({
|
||||
components,
|
||||
|
||||
@@ -11,7 +11,7 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<
|
||||
/**
|
||||
* The options within this select menu
|
||||
*/
|
||||
protected readonly options: UnsafeSelectMenuOptionBuilder[];
|
||||
public readonly options: UnsafeSelectMenuOptionBuilder[];
|
||||
|
||||
public constructor(data?: Partial<APISelectMenuComponent>) {
|
||||
const { options, ...initData } = data ?? {};
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
import { ActionRowBuilder, createComponentBuilder, JSONEncodable, ModalActionRowComponentBuilder } from '../../index';
|
||||
|
||||
export class UnsafeModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData> {
|
||||
protected readonly data: Partial<Omit<APIModalInteractionResponseCallbackData, 'components'>>;
|
||||
public readonly data: Partial<Omit<APIModalInteractionResponseCallbackData, 'components'>>;
|
||||
public readonly components: ActionRowBuilder<ModalActionRowComponentBuilder>[] = [];
|
||||
|
||||
public constructor({ components, ...data }: Partial<APIModalInteractionResponseCallbackData> = {}) {
|
||||
|
||||
Reference in New Issue
Block a user