hennus-api
Version:
Esta es una libreria para el bot Hennus
57 lines (56 loc) • 1.45 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextInputBuilder = void 0;
class TextInputBuilder {
constructor(option) {
this.type = 4;
this.custom_id = option?.custom_id;
this.style = option?.style;
this.label = option?.label;
this.min_length = option?.min_length;
this.max_length = option?.max_length;
this.required = option?.required;
this.placeholder = option?.placeholder;
}
SetCustomID(custom) {
this.custom_id = custom;
return this;
}
SetStyle(style) {
const styleMap = {
"Paragraph": 1,
"Short": 2
};
this.style = typeof style === "number" ? style : styleMap[style];
return this;
}
SetLabel(label) {
this.label = label;
return this;
}
SetMinLength(value) {
if (typeof value === "number") {
this.min_length = value;
}
return this;
}
SetMaxLength(value) {
if (typeof value === "number") {
this.max_length = value;
}
return this;
}
SetRequired(boolean) {
this.required = boolean;
return this;
}
SetValue(value) {
this.value = value;
return this;
}
SetPlaceholder(value) {
this.placeholder = value;
return this;
}
}
exports.TextInputBuilder = TextInputBuilder;