UNPKG

@wilcosp/rex

Version:

Rex is an automated command manager for discord js

30 lines (29 loc) 842 B
/*! * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { ActionRowBuilder, ModalBuilder } from "discord.js"; export class RexModal extends ModalBuilder { constructor(value, title) { if (typeof value == "string") { super(); this.setCustomId(value); if (title) { this.setTitle(title); } return; } super(value); } get customId() { return this.data.custom_id; } get title() { return this.data.title; } addActionRow(...components) { this.addComponents(new ActionRowBuilder().addComponents(components)); return this; } }