UNPKG

hennus-api

Version:

Esta es una libreria para el bot Hennus

38 lines (37 loc) 997 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AttachmentBuilder = void 0; class AttachmentBuilder { constructor(attachment, data = {}) { this.isSpoiler = false; this.attachment = attachment; this.description = data.description ?? null; this.name = data.name ?? null; } ; setDescription(description) { this.description = description; return this; } ; setFile(attachment, name) { this.attachment = attachment; this.name = name || null; return this; } ; setName(name) { this.name = name; return this; } ; setSpoiler(spoiler = true) { if (this.isSpoiler === spoiler) return this; this.isSpoiler = spoiler; this.name = spoiler ? `SPOILER_${this.name || ''}` : this.name?.replace(/^SPOILER_/, '') || null; return this; } ; } exports.AttachmentBuilder = AttachmentBuilder;