@wilcosp/rex
Version:
Rex is an automated command manager for discord js
76 lines (75 loc) • 3.35 kB
TypeScript
/*!
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { APIApplicationCommandIntegerOption, APIApplicationCommandNumberOption, APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from "discord-api-types/v10";
import { RexArray } from "../../types/types.js";
import { RexSlashCommandOptionBase } from "./optionsBase.js";
export declare abstract class RexSlashCommandNumberOptionBase extends RexSlashCommandOptionBase<ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number> {
private _choices?;
private _autocomplete?;
private _minValue?;
private _maxValue?;
/**
* add a choice to this option
* @param name name of the choice
* @param value value of the choice
* @returns this
*/
addChoice(name: string, value: number): Omit<this, "setAutocomplete" | "setMinValue">;
/**
* add choices to this option
* @param choices choices for this option
* @returns this
*/
addChoices(...choices: RexArray<APIApplicationCommandOptionChoice<number>>): Omit<this, "setAutocomplete" | "setMinValue">;
/**
* add choices to this option that share the same name and value
* @param values choice values
* @returns this
*/
addChoicesNormalized(...values: RexArray<number>): Omit<this, "setAutocomplete" | "setMinValue">;
/**
* set the choices for this option, earlier set options will be dropped
* @param choices choices for this option
* @returns this
*/
setChoices(...choices: RexArray<APIApplicationCommandOptionChoice<number>>): Omit<this, "setAutocomplete" | "setMinValue">;
/**
* remove choices from this option
*/
setChoices(): this["setAutocomplete"] extends never ? this & Pick<RexSlashCommandNumberOptionBase, "setAutocomplete" | "setMinValue"> : this;
/**
* set the choices for this option whereby the name & value are the same , earlier set options will be dropped
* @param values values for this option
*/
setChoicesNormalized(...values: RexArray<number>): Omit<this, "setAutocomplete" | "setMinValue">;
/**
* remove choices from this option
*/
setChoicesNormalized(): this["setAutocomplete"] extends never ? this & Pick<RexSlashCommandNumberOptionBase, "setAutocomplete" | "setMinValue"> : this;
/**
* set a minimal value for this option
* @param min minimal value
* @returns this
*/
setMinValue(min: number): this;
/**
* set the maximum value for this option
* @param max the maximum value
* @returns this
*/
setMaxValue(max: number): this;
/**
* turn on autocomplete for this option
* @param value true
*/
setAutocomplete(value: true): Omit<this, "setChoices" | "setChoicesNormalized" | "addChoicesNormalized" | "addChoices">;
/**
* turn off autocomplete
* @param value false
*/
setAutocomplete(value: false): this["setChoices"] extends never ? this & Pick<RexSlashCommandNumberOptionBase, "setChoices" | "setChoicesNormalized" | "addChoicesNormalized" | "addChoices"> : this;
toJSON(): APIApplicationCommandIntegerOption | APIApplicationCommandNumberOption;
}