sheweny
Version:
The powerful framework for create discord bots
56 lines (55 loc) • 2.07 kB
TypeScript
import { BaseStructure } from './index.js';
import { ShewenyError } from '../helpers/index.js';
import type { ShewenyClient } from '../client/Client.js';
import type { SelectMenuInteraction } from 'discord.js';
import type { Awaitable, SelectMenuData, CustomId } from '../typescript/index.js';
/**
* Represents an Select Menu structure
* @extends {BaseStructure}
*/
export declare abstract class SelectMenu extends BaseStructure {
/**
* Cooldown of a button in seconds
* @type {number}
*/
cooldown: number;
/**
* Custom id for one or more select menus
* @type {CustomId}
*/
customId: CustomId;
/**
* Constructor for build a Select Menu
* @param {ShewenyClient} [client] Client framework
* @param {CustomId} [customId] Custom id for one or more select menus
* @param {SelectMenuData | undefined} [options] The options of the select menu
*/
constructor(client: ShewenyClient, customId: CustomId, options?: SelectMenuData);
/**
* This function is executed before executing the `execute` function
* @param {SelectMenuInteraction} interaction Select Menu interaction
* @returns {any | Promise<any>}
*/
before?(interaction: SelectMenuInteraction): Awaitable<unknown>;
/**
* Main function `execute` for the select menus
* @param {SelectMenuInteraction} interaction Select Menus interaction
* @returns {any | Promise<any>}
*/
abstract execute(interaction: SelectMenuInteraction): Awaitable<unknown>;
/**
* Register a select menu in collections
* @returns {Collection<string[]| RegExp[], SelectMenu | ShewenyError>} The select menus collection
*/
register(): Promise<SelectMenu | ShewenyError>;
/**
* Reload a select menu
* @returns {Promise<Collection<string[]| RegExp[], SelectMenu> | ShewenyError>} The select menus collection
*/
reload(): Promise<SelectMenu | ShewenyError>;
/**
* Unregister a select menu from collections
* @returns {boolean}
*/
unregister(): boolean;
}