"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedSlashCommandOptions = void 0;
const Assertions_1 = require("../Assertions");
const boolean_1 = require("../options/boolean");
const channel_1 = require("../options/channel");
const integer_1 = require("../options/integer");
const mentionable_1 = require("../options/mentionable");
const number_1 = require("../options/number");
const role_1 = require("../options/role");
const string_1 = require("../options/string");
const user_1 = require("../options/user");
class SharedSlashCommandOptions {
    constructor() {
        Object.defineProperty(this, "options", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: void 0
        });
    }
    /**
     * Adds a boolean option
     * @param input A function that returns an option builder, or an already built builder
     */
    addBooleanOption(input) {
        return this._sharedAddOptionMethod(input, boolean_1.SlashCommandBooleanOption);
    }
    /**
     * Adds a user option
     * @param input A function that returns an option builder, or an already built builder
     */
    addUserOption(input) {
        return this._sharedAddOptionMethod(input, user_1.SlashCommandUserOption);
    }
    /**
     * Adds a channel option
     * @param input A function that returns an option builder, or an already built builder
     */
    addChannelOption(input) {
        return this._sharedAddOptionMethod(input, channel_1.SlashCommandChannelOption);
    }
    /**
     * Adds a role option
     * @param input A function that returns an option builder, or an already built builder
     */
    addRoleOption(input) {
        return this._sharedAddOptionMethod(input, role_1.SlashCommandRoleOption);
    }
    /**
     * Adds a mentionable option
     * @param input A function that returns an option builder, or an already built builder
     */
    addMentionableOption(input) {
        return this._sharedAddOptionMethod(input, mentionable_1.SlashCommandMentionableOption);
    }
    /**
     * Adds a string option
     * @param input A function that returns an option builder, or an already built builder
     */
    addStringOption(input) {
        return this._sharedAddOptionMethod(input, string_1.SlashCommandStringOption);
    }
    /**
     * Adds an integer option
     * @param input A function that returns an option builder, or an already built builder
     */
    addIntegerOption(input) {
        return this._sharedAddOptionMethod(input, integer_1.SlashCommandIntegerOption);
    }
    /**
     * Adds a number option
     * @param input A function that returns an option builder, or an already built builder
     */
    addNumberOption(input) {
        return this._sharedAddOptionMethod(input, number_1.SlashCommandNumberOption);
    }
    _sharedAddOptionMethod(input, Instance) {
        const { options } = this;
        // First, assert options conditions - we cannot have more than 25 options
        Assertions_1.validateMaxOptionsLength(options);
        // Get the final result
        const result = typeof input === 'function' ? input(new Instance()) : input;
        Assertions_1.assertReturnOfBuilder(result, Instance);
        // Push it
        options.push(result);
        return this;
    }
}
exports.SharedSlashCommandOptions = SharedSlashCommandOptions;
//# sourceMappingURL=CommandOptions.js.map