v2componentsbuilder
Version:
A discord.js v2components builder
22 lines (21 loc) • 516 B
JavaScript
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,
};
}
}