UNPKG

v2componentsbuilder

Version:
22 lines (21 loc) 516 B
import { ComponentType } from 'discord-api-types/v10'; export class V2ActionRowBuilder { constructor() { this.type = ComponentType.ActionRow; } setId(id) { this.id = id; return this; } setComponents(components) { this.components = components.map(c => c.toJSON()); return this; } toJSON() { return { id: this.id ?? undefined, type: ComponentType.ActionRow, components: this.components, }; } }