UNPKG

v2componentsbuilder

Version:
29 lines (28 loc) 748 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.V2ActionRowBuilder = void 0; const v10_1 = require("discord-api-types/v10"); class V2ActionRowBuilder { constructor() { } setId(id) { this.id = id; return this; } setComponents(components) { this.components = components.map((c) => c.toJSON()); return this; } addComponents(components) { this.components = components.map((c) => c.toJSON()); return this; } toJSON() { return { id: this.id ?? undefined, type: v10_1.ComponentType.ActionRow, components: this.components, }; } } exports.V2ActionRowBuilder = V2ActionRowBuilder;