UNPKG

v2componentsbuilder

Version:
27 lines (26 loc) 564 B
import { ComponentType } from 'discord-api-types/v10'; export class File { constructor() { this.type = ComponentType.File; } setId(id) { this.id = id; return this; } setFile(file) { this.file = file; return this; } setSpoiler(spoiler) { this.spoiler = spoiler; return this; } toJSON() { return { id: this.id ?? undefined, type: ComponentType.File, file: this.file, spoiler: this.spoiler ?? false, }; } }