UNPKG

seyfert

Version:

The most advanced framework for discord bots

40 lines (39 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Checkbox = void 0; const types_1 = require("../types"); const Base_1 = require("./Base"); class Checkbox extends Base_1.BaseComponentBuilder { constructor(data = {}) { super({ type: types_1.ComponentType.Checkbox, ...data }); } /** * Sets the ID for the checkbox. * @param id - The ID for the checkbox. * @returns The current Checkbox instance. * @remarks The ID is used by Discord to identify the component when an interaction is received. It must be unique within the message. */ setId(id) { this.data.id = id; return this; } /** * Sets the custom ID for the checkbox. * @param customId - The custom ID for the checkbox. * @returns The current Checkbox instance. */ setCustomId(customId) { this.data.custom_id = customId; return this; } /** * Sets whether the checkbox is selected by default. * @param value - Whether the checkbox is selected by default. * @return The current Checkbox instance. */ setDefault(value) { this.data.default = value; return this; } } exports.Checkbox = Checkbox;