@wilcosp/rex
Version:
Rex is an automated command manager for discord js
41 lines (40 loc) • 1.63 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 { APIApplicationCommandChannelOption, ApplicationCommandOptionType, ChannelType } from "discord-api-types/v10";
import { RexSlashCommandOptionBase } from "./optionsBase.js";
type channelTypesWithoutDM = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
type channelTypesWithoutDMKeys = Exclude<keyof typeof ChannelType, "DM" | "GroupDM">;
/**
* Channel option
*/
export declare class RexSlashCommandChannelOption extends RexSlashCommandOptionBase<ApplicationCommandOptionType.Channel> {
private _channelTypes?;
constructor(name: string, description: string);
get channelTypes(): channelTypesWithoutDM[];
/**
* add channel type you want to accept with this option
* @param ct channel type
* @returns this
*/
addChannelType(ct: channelTypesWithoutDMKeys): this;
/**
* add channel types you want to accept with this option
* @param ct channel types
* @returns this
*/
addChannelTypes(ct: channelTypesWithoutDMKeys[] | channelTypesWithoutDMKeys[][]): this;
/**
* set the channel types you want to accept with this option, earlier set types will be wiped
* @param ct channel types
* @returns this
*/
setChannelTypes(ct: channelTypesWithoutDMKeys[] | channelTypesWithoutDMKeys[][]): this;
/**
* generates the json of this command
*/
toJSON(): APIApplicationCommandChannelOption;
}
export {};