mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
docs: add missing, fix existing (#10842)
* docs: add missing, fix existing * refactor: new stuff * fix: requested changes * fix: use `@link` for `@mixes` Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com> * chore: disable bad eslint rule --------- Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable jsdoc/check-param-names */
|
||||
|
||||
import type { JSONEncodable } from '@discordjs/util';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
@@ -34,13 +32,15 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new modal from API data.
|
||||
* Creates a new modal.
|
||||
*
|
||||
* @param data - The API data to create this modal with
|
||||
*/
|
||||
public constructor({ components = [], ...data }: Partial<APIModalInteractionResponseCallbackData> = {}) {
|
||||
public constructor(data: Partial<APIModalInteractionResponseCallbackData> = {}) {
|
||||
const { components = [], ...rest } = data;
|
||||
|
||||
this.data = {
|
||||
...structuredClone(data),
|
||||
...structuredClone(rest),
|
||||
components: components.map((component) => createComponentBuilder(component)),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user