From 14f07f8aad056b06b85a6796bfe72672a5e39354 Mon Sep 17 00:00:00 2001 From: Smaug6739 Date: Fri, 17 Jun 2022 18:07:44 +0200 Subject: [PATCH] Fix nodejs version --- package.json | 4 +- typings/client/Client.d.ts | 122 +++--- typings/client/ClientUtil.d.ts | 28 +- typings/constants/constants.d.ts | 120 +++--- .../events/interactionAutocompleteCreate.d.ts | 8 +- typings/events/interactionButtonCreate.d.ts | 6 +- typings/events/interactionCommandCreate.d.ts | 8 +- typings/events/interactionCreate.d.ts | 6 +- .../events/interactionSelectMenuCreate.d.ts | 6 +- typings/events/messageCreate.d.ts | 6 +- typings/events/ready.d.ts | 4 +- typings/events/threadCreate.d.ts | 6 +- typings/helpers/ShewenyError.d.ts | 8 +- typings/helpers/ShewenyInformation.d.ts | 18 +- typings/helpers/ShewenyWarning.d.ts | 8 +- typings/helpers/index.d.ts | 6 +- typings/index.d.ts | 52 +-- typings/managers/BaseManager.d.ts | 44 +-- typings/managers/ButtonsManager.d.ts | 72 ++-- typings/managers/CommandsManager.d.ts | 254 ++++++------ typings/managers/EventsManager.d.ts | 94 ++--- typings/managers/InhibitorsManager.d.ts | 72 ++-- typings/managers/SelectMenusManager.d.ts | 72 ++-- typings/managers/index.d.ts | 12 +- typings/structures/BaseStructure.d.ts | 44 +-- typings/structures/Button.d.ts | 120 +++--- typings/structures/Command.d.ts | 272 ++++++------- typings/structures/Event.d.ts | 134 +++---- typings/structures/Inhibitor.d.ts | 142 +++---- typings/structures/SelectMenu.d.ts | 120 +++--- typings/structures/index.d.ts | 12 +- typings/typescript/interfaces.d.ts | 374 +++++++++--------- typings/typescript/types.d.ts | 22 +- typings/utils/client-util.d.ts | 8 +- typings/utils/loadFiles.d.ts | 8 +- typings/utils/readDirFiles.d.ts | 2 +- 36 files changed, 1147 insertions(+), 1147 deletions(-) diff --git a/package.json b/package.json index 7106af09..df0dd0b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sheweny", - "version": "3.4.2", + "version": "3.4.3", "description": "The powerful framework for create discord bots", "main": "build/index.js", "types": "./typings/index.d.ts", @@ -32,7 +32,7 @@ "@sheweny/resolve": "^1.3.2" }, "devDependencies": { - "@types/node": "^16.6.1", + "@types/node": "^16.6.0", "discord.js": "^13.3.0", "ts-node-dev": "^1.1.8" } diff --git a/typings/client/Client.d.ts b/typings/client/Client.d.ts index f1d52a54..348f294b 100644 --- a/typings/client/Client.d.ts +++ b/typings/client/Client.d.ts @@ -1,61 +1,61 @@ -import { Client } from 'discord.js'; -import { ClientUtil } from './ClientUtil'; -import { CLIENT_MODE } from '../constants/constants'; -import type { Snowflake, ClientOptions } from 'discord.js'; -import type { ShewenyClientOptions, Managers, ManagersCollections, Cooldowns } from '../typescript/interfaces'; -/** - * Sheweny framework client - */ -export declare class ShewenyClient extends Client { - /** - * If the client is ready - * @type {boolean} - */ - connected: boolean; - /** - * If the client is ready - * @type {boolean} - */ - cooldowns: Cooldowns; - /** - * The mode of the application (developement or production) - * @type {string} - */ - mode?: typeof CLIENT_MODE.prod | typeof CLIENT_MODE.dev; - /** - * The ID of the bot admins - * @type {Snowflake[]} - */ - admins: Snowflake[]; - /** - * The manager of handlers - * @type {Managers} - */ - managers: Managers; - /** - * The collections of handlers - * @type {Managers} - */ - collections: ManagersCollections; - /** - * A util tool to resolve channel, user, get data etc - * @type {ClientUtil} - */ - util: ClientUtil; - /** - * If the client joins a Thread when created - * @type {boolean} - */ - joinThreadsOnCreate: boolean; - /** - * Set options and your client is ready - * @param {ShewenyClientOptions} options Client framework options - * @param {ClientOptions} [clientOptions] Client discord.js options - */ - constructor(options: ShewenyClientOptions, clientOptions?: ClientOptions); - /** - * Return true when the client is ready - * @returns {Promise} - */ - awaitReady(): Promise; -} +import { Client } from 'discord.js'; +import { ClientUtil } from './ClientUtil'; +import { CLIENT_MODE } from '../constants/constants'; +import type { Snowflake, ClientOptions } from 'discord.js'; +import type { ShewenyClientOptions, Managers, ManagersCollections, Cooldowns } from '../typescript/interfaces'; +/** + * Sheweny framework client + */ +export declare class ShewenyClient extends Client { + /** + * If the client is ready + * @type {boolean} + */ + connected: boolean; + /** + * If the client is ready + * @type {boolean} + */ + cooldowns: Cooldowns; + /** + * The mode of the application (developement or production) + * @type {string} + */ + mode?: typeof CLIENT_MODE.prod | typeof CLIENT_MODE.dev; + /** + * The ID of the bot admins + * @type {Snowflake[]} + */ + admins: Snowflake[]; + /** + * The manager of handlers + * @type {Managers} + */ + managers: Managers; + /** + * The collections of handlers + * @type {Managers} + */ + collections: ManagersCollections; + /** + * A util tool to resolve channel, user, get data etc + * @type {ClientUtil} + */ + util: ClientUtil; + /** + * If the client joins a Thread when created + * @type {boolean} + */ + joinThreadsOnCreate: boolean; + /** + * Set options and your client is ready + * @param {ShewenyClientOptions} options Client framework options + * @param {ClientOptions} [clientOptions] Client discord.js options + */ + constructor(options: ShewenyClientOptions, clientOptions?: ClientOptions); + /** + * Return true when the client is ready + * @returns {Promise} + */ + awaitReady(): Promise; +} diff --git a/typings/client/ClientUtil.d.ts b/typings/client/ClientUtil.d.ts index 8affd41e..d8fc0987 100644 --- a/typings/client/ClientUtil.d.ts +++ b/typings/client/ClientUtil.d.ts @@ -1,14 +1,14 @@ -import { DiscordResolve } from '@sheweny/resolve'; -import type { ShewenyClient } from '..'; -/** - * Utility methods and properties for the client. - */ -export declare class ClientUtil extends DiscordResolve { - client: ShewenyClient; - constructor(client: ShewenyClient); - getCommands(): IterableIterator; - getEvents(): IterableIterator; - getInhibitors(): IterableIterator; - getButtons(): IterableIterator; - getSelectMenus(): IterableIterator; -} +import { DiscordResolve } from '@sheweny/resolve'; +import type { ShewenyClient } from '..'; +/** + * Utility methods and properties for the client. + */ +export declare class ClientUtil extends DiscordResolve { + client: ShewenyClient; + constructor(client: ShewenyClient); + getCommands(): IterableIterator; + getEvents(): IterableIterator; + getInhibitors(): IterableIterator; + getButtons(): IterableIterator; + getSelectMenus(): IterableIterator; +} diff --git a/typings/constants/constants.d.ts b/typings/constants/constants.d.ts index 45fffdf5..fb61df01 100644 --- a/typings/constants/constants.d.ts +++ b/typings/constants/constants.d.ts @@ -1,60 +1,60 @@ -/** - * Client constants - */ -export declare const CLIENT_MODE: { - dev: "development"; - prod: "production"; -}; -export declare const CLIENT_UTIL: { - allIntents: import("discord.js").Intents; - allPartials: import("discord.js").PartialTypes[]; -}; -/** - * Command constants - */ -export declare const COMMAND_TYPE: { - cmdMsg: "MESSAGE_COMMAND"; - cmdSlash: "SLASH_COMMAND"; - ctxMsg: "CONTEXT_MENU_MESSAGE"; - ctxUser: "CONTEXT_MENU_USER"; -}; -export declare const COMMAND_CHANNEL: { - dm: "DM"; - guild: "GUILD"; -}; -export declare const COMMAND_MESSAGE_ARGS_TYPE: { - string: "STRING"; - number: "NUMBER"; - boolean: "BOOLEAN"; - rest: "REST"; - guild: "GUILD"; - channel: "CHANNEL"; - member: "MEMBER"; - guild_emoji: "GUILD_EMOJI"; - role: "ROLE"; - user: "USER"; -}; -export declare const COMMAND_PERMISSIONS: { - admin: "BOT_ADMIN"; -}; -export declare const COMMAND_EVENTS: { - userMissingPerm: "userMissingPermissions"; - clientMissingPerm: "clientMissingPermissions"; - cooldownLimit: "cooldownLimit"; -}; -export declare const BUTTON_EVENTS: { - cooldownLimit: "cooldownLimit"; -}; -export declare const SELECT_EVENTS: { - cooldownLimit: "cooldownLimit"; -}; -/** - * Inhibitor constants - */ -export declare const INHIBITOR_TYPE: { - message: "MESSAGE_COMMAND"; - appCommand: "APPLICATION_COMMAND"; - button: "BUTTON"; - select: "SELECT_MENU"; - all: "ALL"; -}; +/** + * Client constants + */ +export declare const CLIENT_MODE: { + dev: "development"; + prod: "production"; +}; +export declare const CLIENT_UTIL: { + allIntents: import("discord.js").Intents; + allPartials: import("discord.js").PartialTypes[]; +}; +/** + * Command constants + */ +export declare const COMMAND_TYPE: { + cmdMsg: "MESSAGE_COMMAND"; + cmdSlash: "SLASH_COMMAND"; + ctxMsg: "CONTEXT_MENU_MESSAGE"; + ctxUser: "CONTEXT_MENU_USER"; +}; +export declare const COMMAND_CHANNEL: { + dm: "DM"; + guild: "GUILD"; +}; +export declare const COMMAND_MESSAGE_ARGS_TYPE: { + string: "STRING"; + number: "NUMBER"; + boolean: "BOOLEAN"; + rest: "REST"; + guild: "GUILD"; + channel: "CHANNEL"; + member: "MEMBER"; + guild_emoji: "GUILD_EMOJI"; + role: "ROLE"; + user: "USER"; +}; +export declare const COMMAND_PERMISSIONS: { + admin: "BOT_ADMIN"; +}; +export declare const COMMAND_EVENTS: { + userMissingPerm: "userMissingPermissions"; + clientMissingPerm: "clientMissingPermissions"; + cooldownLimit: "cooldownLimit"; +}; +export declare const BUTTON_EVENTS: { + cooldownLimit: "cooldownLimit"; +}; +export declare const SELECT_EVENTS: { + cooldownLimit: "cooldownLimit"; +}; +/** + * Inhibitor constants + */ +export declare const INHIBITOR_TYPE: { + message: "MESSAGE_COMMAND"; + appCommand: "APPLICATION_COMMAND"; + button: "BUTTON"; + select: "SELECT_MENU"; + all: "ALL"; +}; diff --git a/typings/events/interactionAutocompleteCreate.d.ts b/typings/events/interactionAutocompleteCreate.d.ts index 9d6f743d..8f1679d4 100644 --- a/typings/events/interactionAutocompleteCreate.d.ts +++ b/typings/events/interactionAutocompleteCreate.d.ts @@ -1,4 +1,4 @@ -import { AutocompleteInteraction } from 'discord.js'; -import type { ShewenyClient } from '..'; -import type { CommandInteraction, ContextMenuInteraction } from 'discord.js'; -export default function run(client: ShewenyClient, interaction: CommandInteraction | ContextMenuInteraction | AutocompleteInteraction): Promise; +import { AutocompleteInteraction } from 'discord.js'; +import type { ShewenyClient } from '..'; +import type { CommandInteraction, ContextMenuInteraction } from 'discord.js'; +export default function run(client: ShewenyClient, interaction: CommandInteraction | ContextMenuInteraction | AutocompleteInteraction): Promise; diff --git a/typings/events/interactionButtonCreate.d.ts b/typings/events/interactionButtonCreate.d.ts index ec6fb80c..aa85a975 100644 --- a/typings/events/interactionButtonCreate.d.ts +++ b/typings/events/interactionButtonCreate.d.ts @@ -1,3 +1,3 @@ -import type { ButtonInteraction } from 'discord.js'; -import type { ShewenyClient } from '../client/Client'; -export default function run(client: ShewenyClient, interaction: ButtonInteraction): Promise; +import type { ButtonInteraction } from 'discord.js'; +import type { ShewenyClient } from '../client/Client'; +export default function run(client: ShewenyClient, interaction: ButtonInteraction): Promise; diff --git a/typings/events/interactionCommandCreate.d.ts b/typings/events/interactionCommandCreate.d.ts index 9d6f743d..8f1679d4 100644 --- a/typings/events/interactionCommandCreate.d.ts +++ b/typings/events/interactionCommandCreate.d.ts @@ -1,4 +1,4 @@ -import { AutocompleteInteraction } from 'discord.js'; -import type { ShewenyClient } from '..'; -import type { CommandInteraction, ContextMenuInteraction } from 'discord.js'; -export default function run(client: ShewenyClient, interaction: CommandInteraction | ContextMenuInteraction | AutocompleteInteraction): Promise; +import { AutocompleteInteraction } from 'discord.js'; +import type { ShewenyClient } from '..'; +import type { CommandInteraction, ContextMenuInteraction } from 'discord.js'; +export default function run(client: ShewenyClient, interaction: CommandInteraction | ContextMenuInteraction | AutocompleteInteraction): Promise; diff --git a/typings/events/interactionCreate.d.ts b/typings/events/interactionCreate.d.ts index c737f186..00af7539 100644 --- a/typings/events/interactionCreate.d.ts +++ b/typings/events/interactionCreate.d.ts @@ -1,3 +1,3 @@ -import type { Interaction } from 'discord.js'; -import type { ShewenyClient } from '../client/Client'; -export default function run(client: ShewenyClient, interaction: Interaction): void; +import type { Interaction } from 'discord.js'; +import type { ShewenyClient } from '../client/Client'; +export default function run(client: ShewenyClient, interaction: Interaction): void; diff --git a/typings/events/interactionSelectMenuCreate.d.ts b/typings/events/interactionSelectMenuCreate.d.ts index e8c8e7b2..1ada9166 100644 --- a/typings/events/interactionSelectMenuCreate.d.ts +++ b/typings/events/interactionSelectMenuCreate.d.ts @@ -1,3 +1,3 @@ -import type { SelectMenuInteraction } from 'discord.js'; -import type { ShewenyClient } from '../client/Client'; -export default function run(client: ShewenyClient, interaction: SelectMenuInteraction): Promise; +import type { SelectMenuInteraction } from 'discord.js'; +import type { ShewenyClient } from '../client/Client'; +export default function run(client: ShewenyClient, interaction: SelectMenuInteraction): Promise; diff --git a/typings/events/messageCreate.d.ts b/typings/events/messageCreate.d.ts index 0296623a..1ecc75ba 100644 --- a/typings/events/messageCreate.d.ts +++ b/typings/events/messageCreate.d.ts @@ -1,3 +1,3 @@ -import type { ShewenyClient } from '../client/Client'; -import type { Message } from 'discord.js'; -export default function run(client: ShewenyClient, message: Message): Promise; +import type { ShewenyClient } from '../client/Client'; +import type { Message } from 'discord.js'; +export default function run(client: ShewenyClient, message: Message): Promise; diff --git a/typings/events/ready.d.ts b/typings/events/ready.d.ts index fe6e88d0..5302d9ee 100644 --- a/typings/events/ready.d.ts +++ b/typings/events/ready.d.ts @@ -1,2 +1,2 @@ -import type { ShewenyClient } from '../client/Client'; -export default function run(client: ShewenyClient): Promise; +import type { ShewenyClient } from '../client/Client'; +export default function run(client: ShewenyClient): Promise; diff --git a/typings/events/threadCreate.d.ts b/typings/events/threadCreate.d.ts index b87af913..2c33d24f 100644 --- a/typings/events/threadCreate.d.ts +++ b/typings/events/threadCreate.d.ts @@ -1,3 +1,3 @@ -import type { ThreadChannel } from 'discord.js'; -import type { ShewenyClient } from '../client/Client'; -export default function run(client: ShewenyClient, thread: ThreadChannel): Promise; +import type { ThreadChannel } from 'discord.js'; +import type { ShewenyClient } from '../client/Client'; +export default function run(client: ShewenyClient, thread: ThreadChannel): Promise; diff --git a/typings/helpers/ShewenyError.d.ts b/typings/helpers/ShewenyError.d.ts index 5665b746..327ccf3f 100644 --- a/typings/helpers/ShewenyError.d.ts +++ b/typings/helpers/ShewenyError.d.ts @@ -1,4 +1,4 @@ -import { ShewenyClient } from '../client/Client'; -export declare class ShewenyError extends Error { - constructor(client: ShewenyClient, err: any, ...args: any[]); -} +import { ShewenyClient } from '../client/Client'; +export declare class ShewenyError extends Error { + constructor(client: ShewenyClient, err: any, ...args: any[]); +} diff --git a/typings/helpers/ShewenyInformation.d.ts b/typings/helpers/ShewenyInformation.d.ts index 61b9b0a1..890a7beb 100644 --- a/typings/helpers/ShewenyInformation.d.ts +++ b/typings/helpers/ShewenyInformation.d.ts @@ -1,9 +1,9 @@ -import type { ShewenyClient } from '../client/Client'; -/** - * Information class for Sheweny. - */ -export declare class ShewenyInformation { - client: ShewenyClient; - message: string; - constructor(client: ShewenyClient, message: string); -} +import type { ShewenyClient } from '../client/Client'; +/** + * Information class for Sheweny. + */ +export declare class ShewenyInformation { + client: ShewenyClient; + message: string; + constructor(client: ShewenyClient, message: string); +} diff --git a/typings/helpers/ShewenyWarning.d.ts b/typings/helpers/ShewenyWarning.d.ts index 63c8b778..ea0814cd 100644 --- a/typings/helpers/ShewenyWarning.d.ts +++ b/typings/helpers/ShewenyWarning.d.ts @@ -1,4 +1,4 @@ -import type { ShewenyClient } from '../client/Client'; -export declare class ShewenyWarning { - constructor(client: ShewenyClient, name: string, ...args: any[]); -} +import type { ShewenyClient } from '../client/Client'; +export declare class ShewenyWarning { + constructor(client: ShewenyClient, name: string, ...args: any[]); +} diff --git a/typings/helpers/index.d.ts b/typings/helpers/index.d.ts index 4d93673c..fce9c3e8 100644 --- a/typings/helpers/index.d.ts +++ b/typings/helpers/index.d.ts @@ -1,3 +1,3 @@ -export { ShewenyError } from './ShewenyError'; -export { ShewenyWarning } from './ShewenyWarning'; -export { ShewenyInformation } from './ShewenyInformation'; +export { ShewenyError } from './ShewenyError'; +export { ShewenyWarning } from './ShewenyWarning'; +export { ShewenyInformation } from './ShewenyInformation'; diff --git a/typings/index.d.ts b/typings/index.d.ts index 29591754..338e8023 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1,26 +1,26 @@ -/** - * Sheweny framework : A powerful framework for building discord bots. - * Documentation: https://sheweny.js.org - * NPM: https://www.npmjs.com/package/sheweny - * Author : Smaug6739 https://github.com/Smaug6739 - * License: MIT - * Version: 3 - */ -/** - * Client class - */ -export { ShewenyClient } from './client/Client'; -export { ClientUtil } from './client/ClientUtil'; -/** - * Structures - */ -export { BaseStructure, Button, Command, Event, Inhibitor, SelectMenu } from './structures'; -/** - * Managers - */ -export { BaseManager, ButtonsManager, CommandsManager, EventsManager, InhibitorsManager, SelectMenusManager } from './managers'; -/** - * Helpers - */ -export { ShewenyError, ShewenyInformation, ShewenyWarning } from './helpers'; -export * as Constants from './constants/constants'; +/** + * Sheweny framework : A powerful framework for building discord bots. + * Documentation: https://sheweny.js.org + * NPM: https://www.npmjs.com/package/sheweny + * Author : Smaug6739 https://github.com/Smaug6739 + * License: MIT + * Version: 3 + */ +/** + * Client class + */ +export { ShewenyClient } from './client/Client'; +export { ClientUtil } from './client/ClientUtil'; +/** + * Structures + */ +export { BaseStructure, Button, Command, Event, Inhibitor, SelectMenu } from './structures'; +/** + * Managers + */ +export { BaseManager, ButtonsManager, CommandsManager, EventsManager, InhibitorsManager, SelectMenusManager } from './managers'; +/** + * Helpers + */ +export { ShewenyError, ShewenyInformation, ShewenyWarning } from './helpers'; +export * as Constants from './constants/constants'; diff --git a/typings/managers/BaseManager.d.ts b/typings/managers/BaseManager.d.ts index e2b3a11e..c981d99a 100644 --- a/typings/managers/BaseManager.d.ts +++ b/typings/managers/BaseManager.d.ts @@ -1,22 +1,22 @@ -/// -import { EventEmitter } from 'events'; -import { ShewenyClient } from '..'; -import type { BaseManagerOptions } from '../typescript/interfaces'; -export declare class BaseManager extends EventEmitter { - /** - * Client framework - * @type {ShewenyClient} - */ - client: ShewenyClient; - /** - * Directory to load - * @type {string} - */ - directory: string; - /** - * Constructor of BaseManager class (extends EventEmitter) - * @param {ShewenyClient} client - * @param {BaseManagerOptions} options - */ - constructor(client: ShewenyClient, options: BaseManagerOptions); -} +/// +import { EventEmitter } from 'events'; +import { ShewenyClient } from '..'; +import type { BaseManagerOptions } from '../typescript/interfaces'; +export declare class BaseManager extends EventEmitter { + /** + * Client framework + * @type {ShewenyClient} + */ + client: ShewenyClient; + /** + * Directory to load + * @type {string} + */ + directory: string; + /** + * Constructor of BaseManager class (extends EventEmitter) + * @param {ShewenyClient} client + * @param {BaseManagerOptions} options + */ + constructor(client: ShewenyClient, options: BaseManagerOptions); +} diff --git a/typings/managers/ButtonsManager.d.ts b/typings/managers/ButtonsManager.d.ts index 01bc9a19..9908f33f 100644 --- a/typings/managers/ButtonsManager.d.ts +++ b/typings/managers/ButtonsManager.d.ts @@ -1,36 +1,36 @@ -import { Collection } from 'discord.js'; -import { BaseManager } from '.'; -import type { ShewenyClient, Button } from '..'; -import type { ButtonsManagerDefaultOptions, ButtonsManagerOptions } from '../typescript/interfaces'; -/** - * Manager for Buttons - */ -export declare class ButtonsManager extends BaseManager { - /** - * Collection of the buttons - * @type {Collection | undefined} - */ - buttons?: Collection | null; - /** - * Default data for the buttons - * @type {Collection | undefined} - */ - default?: ButtonsManagerDefaultOptions; - /** - * Constructor to manage buttons - * @param {ShewenyClient} client Client framework - * @param {string} directory Directory of the buttons folder - * @param {boolean} [loadAll] If the buttons are loaded during bot launch - */ - constructor(client: ShewenyClient, options: ButtonsManagerOptions); - /** - * Load all buttons in collection - * @returns {Promise>} - */ - loadAll(): Promise | undefined>; - /** - * Unload all buttons - * @returns {void} - */ - unloadAll(): void; -} +import { Collection } from 'discord.js'; +import { BaseManager } from '.'; +import type { ShewenyClient, Button } from '..'; +import type { ButtonsManagerDefaultOptions, ButtonsManagerOptions } from '../typescript/interfaces'; +/** + * Manager for Buttons + */ +export declare class ButtonsManager extends BaseManager { + /** + * Collection of the buttons + * @type {Collection | undefined} + */ + buttons?: Collection | null; + /** + * Default data for the buttons + * @type {Collection | undefined} + */ + default?: ButtonsManagerDefaultOptions; + /** + * Constructor to manage buttons + * @param {ShewenyClient} client Client framework + * @param {string} directory Directory of the buttons folder + * @param {boolean} [loadAll] If the buttons are loaded during bot launch + */ + constructor(client: ShewenyClient, options: ButtonsManagerOptions); + /** + * Load all buttons in collection + * @returns {Promise>} + */ + loadAll(): Promise | undefined>; + /** + * Unload all buttons + * @returns {void} + */ + unloadAll(): void; +} diff --git a/typings/managers/CommandsManager.d.ts b/typings/managers/CommandsManager.d.ts index 20be5b20..9ab51dc1 100644 --- a/typings/managers/CommandsManager.d.ts +++ b/typings/managers/CommandsManager.d.ts @@ -1,127 +1,127 @@ -import { Collection } from 'discord.js'; -import { BaseManager } from '.'; -import type { ApplicationCommand, ApplicationCommandData, ApplicationCommandResolvable, GuildResolvable, Snowflake } from 'discord.js'; -import type { ShewenyClient, Command } from '..'; -import type { CommandsManagerOptions, CommandsManagerDefaultOptions } from '../typescript/interfaces'; -/** - * Manager for Commands - * @extends {EventEmitter} - */ -export declare class CommandsManager extends BaseManager { - /** - * If the applications commands are disabled according to the `userPermissions` array - * @type {boolean | undefined} - */ - applicationPermissions?: boolean; - /** - * Register application commands - * @type {boolean} - */ - autoRegisterApplicationCommands: boolean; - /** - * Collection of the commands - * @type {Collection | undefined} - */ - commands?: Collection | null; - /** - * Default data for the commands - * @type {CommandsManagerDefaultOptions} - */ - default: CommandsManagerDefaultOptions; - /** - * ID of the guild where are set Applications Commands - * @type {string | undefined} - */ - guildId?: Snowflake | Snowflake[]; - /** - * Prefix for the Message Commands - * @type {string | undefined} - */ - prefix?: string; - /** - * Constructor to manage commands - * @param {ShewenyClient} client Client framework - * @param {string} directory Directory of the commands folder - * @param {CommandsManagerOptions} [options] Options of the commands manager - */ - constructor(client: ShewenyClient, options: CommandsManagerOptions); - /** - * Load all and Register Application commands - * @returns {Promise} - */ - loadAndRegisterAll(): Promise; - /** - * Load all commands in collection - * @returns {Promise>} - */ - loadAll(): Promise | undefined>; - /** - * Unload all commands - * @returns {void} - */ - unloadAll(): void; - /** - * Set all application commands from the collection of commands in the client application - * @param {Collection | undefined} [commands] Collection of the commands - * @returns {Promise> | Collection> | undefined>} - */ - registerApplicationCommands(commands?: Collection | undefined | null, guildId?: Snowflake | Snowflake[] | undefined): Promise> | Collection> | boolean | undefined>; - /** - * Rename command type to the type of Application command - * @param {"SLASH_COMMAND" | "CONTEXT_MENU_USER" | "CONTEXT_MENU_MESSAGE"} type Type of command - * @returns {ApplicationCommandType | undefined} - */ - private renameCommandType; - /** - * Get data of Application Command - * @param {Collection | Command | undefined} [commands] The command(s) to obtain their data - * @returns {ApplicationCommandData[] | ApplicationCommandData | undefined} - */ - getApplicationCommandData(commands?: Collection | Command | undefined | null): ApplicationCommandData[] | ApplicationCommandData | null; - /** - * Set permissions for each commands in guild - * @param {Collection> | undefined} [applicationCommands] Commands coming from the client's application - * @param {Collection | undefined} [commandsCollection] Commands coming from the collection of the commands - * @param {Snowflake | undefined} [guildId] Guild ID where permissions will be set - * @returns {Promise} - */ - registerPermissions(applicationCommands: Collection> | undefined, commandsCollection: Collection | undefined | null, guildId: Snowflake | undefined): Promise; - /** - * Create a command in the client's application commands - * @param {Command} command Command to create - * @param {Snowflake | undefined} [guildId] Guild ID where the order will be created - * @returns {Promise | ApplicationCommand<{ guild: GuildResolvable }> | undefined>} - */ - createCommand(command: Command, guildId?: Snowflake): Promise | ApplicationCommand<{ - guild: GuildResolvable; - }> | undefined>; - /** - * Edit an command with a new command in the client's application commands - * @param {ApplicationCommandResolvable} oldCommand Command edited - * @param {Command} newCommand The new command that will take the place of the old one - * @param {Snowflake | undefined} [guildId] Guild ID where the order will be edited - * @returns {Promise | ApplicationCommand<{ guild: GuildResolvable }> | undefined>} - */ - editCommand(oldCommand: ApplicationCommandResolvable, newCommand: Command, guildId?: Snowflake): Promise | ApplicationCommand<{ - guild: GuildResolvable; - }> | undefined>; - /** - * Removes an command from the client's application commands - * @param {ApplicationCommandResolvable} command Command deleted - * @param {Snowflake | undefined} [guildId] Guild ID where the command will be deleted - * @returns {Promise | null | undefined>} - */ - deleteCommand(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise | null | undefined>; - /** - * Delete all commands from the client's application commands - * @param {Snowflake | undefined} [guildId] Guild ID where all commands will be deleted - * @returns {Promise> | Collection> | undefined>} - */ - deleteAllCommands(guildId?: Snowflake): Promise> | Collection> | undefined>; -} +import { Collection } from 'discord.js'; +import { BaseManager } from '.'; +import type { ApplicationCommand, ApplicationCommandData, ApplicationCommandResolvable, GuildResolvable, Snowflake } from 'discord.js'; +import type { ShewenyClient, Command } from '..'; +import type { CommandsManagerOptions, CommandsManagerDefaultOptions } from '../typescript/interfaces'; +/** + * Manager for Commands + * @extends {EventEmitter} + */ +export declare class CommandsManager extends BaseManager { + /** + * If the applications commands are disabled according to the `userPermissions` array + * @type {boolean | undefined} + */ + applicationPermissions?: boolean; + /** + * Register application commands + * @type {boolean} + */ + autoRegisterApplicationCommands: boolean; + /** + * Collection of the commands + * @type {Collection | undefined} + */ + commands?: Collection | null; + /** + * Default data for the commands + * @type {CommandsManagerDefaultOptions} + */ + default: CommandsManagerDefaultOptions; + /** + * ID of the guild where are set Applications Commands + * @type {string | undefined} + */ + guildId?: Snowflake | Snowflake[]; + /** + * Prefix for the Message Commands + * @type {string | undefined} + */ + prefix?: string; + /** + * Constructor to manage commands + * @param {ShewenyClient} client Client framework + * @param {string} directory Directory of the commands folder + * @param {CommandsManagerOptions} [options] Options of the commands manager + */ + constructor(client: ShewenyClient, options: CommandsManagerOptions); + /** + * Load all and Register Application commands + * @returns {Promise} + */ + loadAndRegisterAll(): Promise; + /** + * Load all commands in collection + * @returns {Promise>} + */ + loadAll(): Promise | undefined>; + /** + * Unload all commands + * @returns {void} + */ + unloadAll(): void; + /** + * Set all application commands from the collection of commands in the client application + * @param {Collection | undefined} [commands] Collection of the commands + * @returns {Promise> | Collection> | undefined>} + */ + registerApplicationCommands(commands?: Collection | undefined | null, guildId?: Snowflake | Snowflake[] | undefined): Promise> | Collection> | boolean | undefined>; + /** + * Rename command type to the type of Application command + * @param {"SLASH_COMMAND" | "CONTEXT_MENU_USER" | "CONTEXT_MENU_MESSAGE"} type Type of command + * @returns {ApplicationCommandType | undefined} + */ + private renameCommandType; + /** + * Get data of Application Command + * @param {Collection | Command | undefined} [commands] The command(s) to obtain their data + * @returns {ApplicationCommandData[] | ApplicationCommandData | undefined} + */ + getApplicationCommandData(commands?: Collection | Command | undefined | null): ApplicationCommandData[] | ApplicationCommandData | null; + /** + * Set permissions for each commands in guild + * @param {Collection> | undefined} [applicationCommands] Commands coming from the client's application + * @param {Collection | undefined} [commandsCollection] Commands coming from the collection of the commands + * @param {Snowflake | undefined} [guildId] Guild ID where permissions will be set + * @returns {Promise} + */ + registerPermissions(applicationCommands: Collection> | undefined, commandsCollection: Collection | undefined | null, guildId: Snowflake | undefined): Promise; + /** + * Create a command in the client's application commands + * @param {Command} command Command to create + * @param {Snowflake | undefined} [guildId] Guild ID where the order will be created + * @returns {Promise | ApplicationCommand<{ guild: GuildResolvable }> | undefined>} + */ + createCommand(command: Command, guildId?: Snowflake): Promise | ApplicationCommand<{ + guild: GuildResolvable; + }> | undefined>; + /** + * Edit an command with a new command in the client's application commands + * @param {ApplicationCommandResolvable} oldCommand Command edited + * @param {Command} newCommand The new command that will take the place of the old one + * @param {Snowflake | undefined} [guildId] Guild ID where the order will be edited + * @returns {Promise | ApplicationCommand<{ guild: GuildResolvable }> | undefined>} + */ + editCommand(oldCommand: ApplicationCommandResolvable, newCommand: Command, guildId?: Snowflake): Promise | ApplicationCommand<{ + guild: GuildResolvable; + }> | undefined>; + /** + * Removes an command from the client's application commands + * @param {ApplicationCommandResolvable} command Command deleted + * @param {Snowflake | undefined} [guildId] Guild ID where the command will be deleted + * @returns {Promise | null | undefined>} + */ + deleteCommand(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise | null | undefined>; + /** + * Delete all commands from the client's application commands + * @param {Snowflake | undefined} [guildId] Guild ID where all commands will be deleted + * @returns {Promise> | Collection> | undefined>} + */ + deleteAllCommands(guildId?: Snowflake): Promise> | Collection> | undefined>; +} diff --git a/typings/managers/EventsManager.d.ts b/typings/managers/EventsManager.d.ts index 1d79286a..0b1de479 100644 --- a/typings/managers/EventsManager.d.ts +++ b/typings/managers/EventsManager.d.ts @@ -1,47 +1,47 @@ -import { Collection } from 'discord.js'; -import { BaseManager } from '.'; -import type { EventsManagerOptions, EventsManagerDefaultOptions } from '../typescript/interfaces'; -import type { ShewenyClient, Event } from '..'; -/** - * Manager for Events - */ -export declare class EventsManager extends BaseManager { - /** - * Default data for the events - * @type {EventsManagerDefaultOptions} - */ - default: EventsManagerDefaultOptions; - /** - * Collection of the events - * @type {Collection | undefined} - */ - events?: Collection | null; - /** - * Constructor to manage events - * @param {ShewenyClient} client Client framework - * @param {string} directory Directory of the events folder - * @param {boolean} [loadAll] If the events are loaded during bot launch - */ - constructor(client: ShewenyClient, options: EventsManagerOptions); - /** - * Load all events in collection - * @returns {Promise>} - */ - loadAll(): Promise | undefined>; - /** - * Emit all events in collection - * @param {Collection | undefined} [events] Events collection that will be emit - * @returns {Promise} - */ - registerAll(events?: Collection | undefined | null): Promise; - /** - * Load all and Register events - * @returns {Promise} - */ - loadAndRegisterAll(): Promise; - /** - * Unload all events - * @returns {void} - */ - unloadAll(): void; -} +import { Collection } from 'discord.js'; +import { BaseManager } from '.'; +import type { EventsManagerOptions, EventsManagerDefaultOptions } from '../typescript/interfaces'; +import type { ShewenyClient, Event } from '..'; +/** + * Manager for Events + */ +export declare class EventsManager extends BaseManager { + /** + * Default data for the events + * @type {EventsManagerDefaultOptions} + */ + default: EventsManagerDefaultOptions; + /** + * Collection of the events + * @type {Collection | undefined} + */ + events?: Collection | null; + /** + * Constructor to manage events + * @param {ShewenyClient} client Client framework + * @param {string} directory Directory of the events folder + * @param {boolean} [loadAll] If the events are loaded during bot launch + */ + constructor(client: ShewenyClient, options: EventsManagerOptions); + /** + * Load all events in collection + * @returns {Promise>} + */ + loadAll(): Promise | undefined>; + /** + * Emit all events in collection + * @param {Collection | undefined} [events] Events collection that will be emit + * @returns {Promise} + */ + registerAll(events?: Collection | undefined | null): Promise; + /** + * Load all and Register events + * @returns {Promise} + */ + loadAndRegisterAll(): Promise; + /** + * Unload all events + * @returns {void} + */ + unloadAll(): void; +} diff --git a/typings/managers/InhibitorsManager.d.ts b/typings/managers/InhibitorsManager.d.ts index edfe9e0d..016bb26d 100644 --- a/typings/managers/InhibitorsManager.d.ts +++ b/typings/managers/InhibitorsManager.d.ts @@ -1,36 +1,36 @@ -import { Collection } from 'discord.js'; -import { BaseManager } from '.'; -import type { ShewenyClient, Inhibitor } from '..'; -import type { InhibitorsManagerOptions, InhibitorsManagerDefaultOptions } from '../typescript/interfaces'; -/** - * Manager for Inhibitors - */ -export declare class InhibitorsManager extends BaseManager { - /** - * Default data for the inhibitors - * @type {InhibitorsManagerDefaultOptions} - */ - default: InhibitorsManagerDefaultOptions; - /** - * Collection of the inhibitors - * @type {Collection | undefined} - */ - inhibitors?: Collection | null; - /** - * Constructor to manage inhibitors - * @param {ShewenyClient} client Client framework - * @param {string} directory Directory of the inhibitors folder - * @param {boolean} [loadAll] If the inhibitors are loaded during bot launch - */ - constructor(client: ShewenyClient, options: InhibitorsManagerOptions); - /** - * Load all inhibitors in collection - * @returns {Promise>} - */ - loadAll(): Promise | undefined>; - /** - * Unload all inhibitors - * @returns {void} - */ - unloadAll(): void; -} +import { Collection } from 'discord.js'; +import { BaseManager } from '.'; +import type { ShewenyClient, Inhibitor } from '..'; +import type { InhibitorsManagerOptions, InhibitorsManagerDefaultOptions } from '../typescript/interfaces'; +/** + * Manager for Inhibitors + */ +export declare class InhibitorsManager extends BaseManager { + /** + * Default data for the inhibitors + * @type {InhibitorsManagerDefaultOptions} + */ + default: InhibitorsManagerDefaultOptions; + /** + * Collection of the inhibitors + * @type {Collection | undefined} + */ + inhibitors?: Collection | null; + /** + * Constructor to manage inhibitors + * @param {ShewenyClient} client Client framework + * @param {string} directory Directory of the inhibitors folder + * @param {boolean} [loadAll] If the inhibitors are loaded during bot launch + */ + constructor(client: ShewenyClient, options: InhibitorsManagerOptions); + /** + * Load all inhibitors in collection + * @returns {Promise>} + */ + loadAll(): Promise | undefined>; + /** + * Unload all inhibitors + * @returns {void} + */ + unloadAll(): void; +} diff --git a/typings/managers/SelectMenusManager.d.ts b/typings/managers/SelectMenusManager.d.ts index 8e862cfe..d04a8a8b 100644 --- a/typings/managers/SelectMenusManager.d.ts +++ b/typings/managers/SelectMenusManager.d.ts @@ -1,36 +1,36 @@ -import { Collection } from 'discord.js'; -import { BaseManager } from '.'; -import type { ShewenyClient, SelectMenu } from '..'; -import type { SelectMenusManagerDefaultOptions, SelectMenusManagerOptions } from '../typescript/interfaces'; -/** - * Manager for Select Menus - */ -export declare class SelectMenusManager extends BaseManager { - /** - * Default data for the buttons - * @type {Collection | undefined} - */ - default?: SelectMenusManagerDefaultOptions; - /** - * Collection of the select menus - * @type {Collection | undefined} - */ - selectMenus?: Collection | null; - /** - * Constructor to manage select menus - * @param {ShewenyClient} client Client framework - * @param {string} directory Directory of the select menus folder - * @param {boolean} [loadAll] If the select menus are loaded during bot launch - */ - constructor(client: ShewenyClient, options: SelectMenusManagerOptions); - /** - * Load all select menus in collection - * @returns {Promise>} - */ - loadAll(): Promise | undefined>; - /** - * Unload all selectMenus - * @returns {void} - */ - unloadAll(): void; -} +import { Collection } from 'discord.js'; +import { BaseManager } from '.'; +import type { ShewenyClient, SelectMenu } from '..'; +import type { SelectMenusManagerDefaultOptions, SelectMenusManagerOptions } from '../typescript/interfaces'; +/** + * Manager for Select Menus + */ +export declare class SelectMenusManager extends BaseManager { + /** + * Default data for the buttons + * @type {Collection | undefined} + */ + default?: SelectMenusManagerDefaultOptions; + /** + * Collection of the select menus + * @type {Collection | undefined} + */ + selectMenus?: Collection | null; + /** + * Constructor to manage select menus + * @param {ShewenyClient} client Client framework + * @param {string} directory Directory of the select menus folder + * @param {boolean} [loadAll] If the select menus are loaded during bot launch + */ + constructor(client: ShewenyClient, options: SelectMenusManagerOptions); + /** + * Load all select menus in collection + * @returns {Promise>} + */ + loadAll(): Promise | undefined>; + /** + * Unload all selectMenus + * @returns {void} + */ + unloadAll(): void; +} diff --git a/typings/managers/index.d.ts b/typings/managers/index.d.ts index 2b2944e3..ad25a4f2 100644 --- a/typings/managers/index.d.ts +++ b/typings/managers/index.d.ts @@ -1,6 +1,6 @@ -export { BaseManager } from './BaseManager'; -export { ButtonsManager } from './ButtonsManager'; -export { CommandsManager } from './CommandsManager'; -export { EventsManager } from './EventsManager'; -export { InhibitorsManager } from './InhibitorsManager'; -export { SelectMenusManager } from './SelectMenusManager'; +export { BaseManager } from './BaseManager'; +export { ButtonsManager } from './ButtonsManager'; +export { CommandsManager } from './CommandsManager'; +export { EventsManager } from './EventsManager'; +export { InhibitorsManager } from './InhibitorsManager'; +export { SelectMenusManager } from './SelectMenusManager'; diff --git a/typings/structures/BaseStructure.d.ts b/typings/structures/BaseStructure.d.ts index 3711ee87..aa492133 100644 --- a/typings/structures/BaseStructure.d.ts +++ b/typings/structures/BaseStructure.d.ts @@ -1,22 +1,22 @@ -import type { ShewenyClient } from '../'; -/** - * The base class for all structures - */ -export declare abstract class BaseStructure { - /** - * Client framework - * @type {ShewenyClient} - */ - client: ShewenyClient; - /** - * Path to file - * @type {string} - */ - path?: string; - /** - * Constructor for build base of any structures - * @param {ShewenyClient} client Client framework - * @param {string} [path] Path for the structure - */ - constructor(client: ShewenyClient | any, path?: string); -} +import type { ShewenyClient } from '../'; +/** + * The base class for all structures + */ +export declare abstract class BaseStructure { + /** + * Client framework + * @type {ShewenyClient} + */ + client: ShewenyClient; + /** + * Path to file + * @type {string} + */ + path?: string; + /** + * Constructor for build base of any structures + * @param {ShewenyClient} client Client framework + * @param {string} [path] Path for the structure + */ + constructor(client: ShewenyClient | any, path?: string); +} diff --git a/typings/structures/Button.d.ts b/typings/structures/Button.d.ts index 94840718..9879c7e2 100644 --- a/typings/structures/Button.d.ts +++ b/typings/structures/Button.d.ts @@ -1,60 +1,60 @@ -import { Collection } from 'discord.js'; -import { BaseStructure } from '.'; -import type { ButtonInteraction } from 'discord.js'; -import type { ButtonsManager } from '..'; -import type { ShewenyClient } from '../client/Client'; -import { ButtonData } from '../typescript/interfaces'; -/** - * Represents an Button structure - * @extends {BaseStructure} - */ -export declare abstract class Button extends BaseStructure { - /** - * Cooldown of a command in seconds - * @type {number} - */ - cooldown: number; - /** - * Custom id for one or more buttons - * @type {string[] | RegExp[]} - */ - customId: string[] | RegExp[]; - /** - * The - * @type {ButtonsManager} - */ - manager?: ButtonsManager; - /** - * Constructor for build a Button - * @param {ShewenyClient} client Client framework - * @param {string[] | RegExp[]} customId Custom id for one or more buttons - */ - constructor(client: ShewenyClient, customId: string[] | RegExp[], data?: ButtonData); - /** - * This function is executed before executing the `execute` function - * @param {ButtonInteraction} interaction Button interaction - * @returns {any | Promise} - */ - before?(interaction: ButtonInteraction): any | Promise; - /** - * Main function `execute` for the buttons - * @param {ButtonInteraction} interaction Button interaction - * @returns {any | Promise} - */ - abstract execute(interaction: ButtonInteraction): any | Promise; - /** - * Unregister a button from collections - * @returns {boolean} - */ - unregister(): boolean; - /** - * Reload a button - * @returns {Promise | null>} - */ - reload(): Promise | null>; - /** - * Register a button in collections - * @returns {Collection} - */ - register(): Promise>; -} +import { Collection } from 'discord.js'; +import { BaseStructure } from '.'; +import type { ButtonInteraction } from 'discord.js'; +import type { ButtonsManager } from '..'; +import type { ShewenyClient } from '../client/Client'; +import { ButtonData } from '../typescript/interfaces'; +/** + * Represents an Button structure + * @extends {BaseStructure} + */ +export declare abstract class Button extends BaseStructure { + /** + * Cooldown of a command in seconds + * @type {number} + */ + cooldown: number; + /** + * Custom id for one or more buttons + * @type {string[] | RegExp[]} + */ + customId: string[] | RegExp[]; + /** + * The + * @type {ButtonsManager} + */ + manager?: ButtonsManager; + /** + * Constructor for build a Button + * @param {ShewenyClient} client Client framework + * @param {string[] | RegExp[]} customId Custom id for one or more buttons + */ + constructor(client: ShewenyClient, customId: string[] | RegExp[], data?: ButtonData); + /** + * This function is executed before executing the `execute` function + * @param {ButtonInteraction} interaction Button interaction + * @returns {any | Promise} + */ + before?(interaction: ButtonInteraction): any | Promise; + /** + * Main function `execute` for the buttons + * @param {ButtonInteraction} interaction Button interaction + * @returns {any | Promise} + */ + abstract execute(interaction: ButtonInteraction): any | Promise; + /** + * Unregister a button from collections + * @returns {boolean} + */ + unregister(): boolean; + /** + * Reload a button + * @returns {Promise | null>} + */ + reload(): Promise | null>; + /** + * Register a button in collections + * @returns {Collection} + */ + register(): Promise>; +} diff --git a/typings/structures/Command.d.ts b/typings/structures/Command.d.ts index 4b390fce..40eb0342 100644 --- a/typings/structures/Command.d.ts +++ b/typings/structures/Command.d.ts @@ -1,136 +1,136 @@ -import { Collection } from 'discord.js'; -import { BaseStructure } from '.'; -import { COMMAND_CHANNEL } from '../constants/constants'; -import type { ShewenyClient } from '../client/Client'; -import type { MessageCommandOptionData, CommandMessageArgsResolved } from '../typescript/interfaces'; -import type { CommandData, CommandType } from '../typescript/types'; -import type { ApplicationCommandOptionData, CommandInteraction, ContextMenuInteraction, Message, PermissionString, AutocompleteInteraction } from 'discord.js'; -import type { CommandsManager } from '..'; -/** - * Represents an Command structure - * @extends {BaseStructure} - */ -export declare abstract class Command extends BaseStructure { - /** - * Name of a command - * @type {string} - */ - name: string; - /** - * Description of a command - * @type {string | undefined} - */ - description?: string; - /** - * Type of a command - * @type {CommandType} - */ - type: CommandType; - /** - * Default permission of a Application command - * @type {boolean | undefined} - */ - defaultPermission?: boolean; - /** - * Options of a Application command - * @type {ApplicationCommandOptionData[] | undefined} - */ - options?: ApplicationCommandOptionData[]; - /** - * Args of a Message command - * @type {MessageCommandOptionData | undefined} - */ - args?: MessageCommandOptionData[]; - /** - * Category of a command - * @type {string} - */ - category: string; - /** - * Usage of a command - * @type {string} - */ - usage?: string | string[]; - /** - * Examples of a command - * @type {string} - */ - examples?: string | string[]; - /** - * Only channel where a command can be executed - * @type {"GUILD" | "DM" | undefined} - */ - channel?: typeof COMMAND_CHANNEL.guild | typeof COMMAND_CHANNEL.dm; - /** - * Cooldown of a command in seconds - * @type {number} - */ - cooldown: number; - /** - * If a command is reserved for bot admins - * @type {boolean} - */ - adminsOnly: boolean; - /** - * The permissions required to be executed by the user - * @type {PermissionString[]} - */ - userPermissions: PermissionString[]; - /** - * The permissions required for the client - * @type {PermissionString[]} - */ - clientPermissions: PermissionString[]; - /** - * Aliases of the Message command - * @type {string[] | undefined} - */ - aliases?: string[]; - /** - * Cooldowns collection - * @type {Collection>} - */ - cooldowns: Collection>; - /** - * The - * @type {CommandsManager} - */ - manager?: CommandsManager; - /** - * Constructor for build a Command - * @param {ShewenyClient} client Client framework - * @param {CommandData} data Data for build a Command - */ - constructor(client: ShewenyClient, data: CommandData); - /** - * This function is executed before executing the `execute` function - * @param {CommandInteraction | ContextMenuInteraction | Message} interaction Interaction - * @returns {any | Promise} - */ - before?(interaction: CommandInteraction | ContextMenuInteraction | Message): any | Promise; - onAutocomplete?(interaction: AutocompleteInteraction): any | Promise; - /** - * Main function `execute` for the commands - * @param {CommandInteraction | ContextMenuInteraction | Message} interaction Interaction - * @param {CommandMessageArgsResolved[]} [args] Arguments of the Message command - * @returns {any | Promise} - */ - abstract execute(interaction: CommandInteraction | ContextMenuInteraction | Message, args?: CommandMessageArgsResolved[]): //args?: CommandMessageArgsResolved - any | Promise; - /** - * Unregister a command from collections - * @returns {boolean} - */ - unregister(): boolean; - /** - * Reload a command - * @returns {Promise | null>} The Application Commands collection - */ - reload(): Promise | null>; - /** - * Register a command in collections - * @returns {Collection} The Application Commands collection - */ - register(): Promise>; - private isType; -} +import { Collection } from 'discord.js'; +import { BaseStructure } from '.'; +import { COMMAND_CHANNEL } from '../constants/constants'; +import type { ShewenyClient } from '../client/Client'; +import type { MessageCommandOptionData, CommandMessageArgsResolved } from '../typescript/interfaces'; +import type { CommandData, CommandType } from '../typescript/types'; +import type { ApplicationCommandOptionData, CommandInteraction, ContextMenuInteraction, Message, PermissionString, AutocompleteInteraction } from 'discord.js'; +import type { CommandsManager } from '..'; +/** + * Represents an Command structure + * @extends {BaseStructure} + */ +export declare abstract class Command extends BaseStructure { + /** + * Name of a command + * @type {string} + */ + name: string; + /** + * Description of a command + * @type {string | undefined} + */ + description?: string; + /** + * Type of a command + * @type {CommandType} + */ + type: CommandType; + /** + * Default permission of a Application command + * @type {boolean | undefined} + */ + defaultPermission?: boolean; + /** + * Options of a Application command + * @type {ApplicationCommandOptionData[] | undefined} + */ + options?: ApplicationCommandOptionData[]; + /** + * Args of a Message command + * @type {MessageCommandOptionData | undefined} + */ + args?: MessageCommandOptionData[]; + /** + * Category of a command + * @type {string} + */ + category: string; + /** + * Usage of a command + * @type {string} + */ + usage?: string | string[]; + /** + * Examples of a command + * @type {string} + */ + examples?: string | string[]; + /** + * Only channel where a command can be executed + * @type {"GUILD" | "DM" | undefined} + */ + channel?: typeof COMMAND_CHANNEL.guild | typeof COMMAND_CHANNEL.dm; + /** + * Cooldown of a command in seconds + * @type {number} + */ + cooldown: number; + /** + * If a command is reserved for bot admins + * @type {boolean} + */ + adminsOnly: boolean; + /** + * The permissions required to be executed by the user + * @type {PermissionString[]} + */ + userPermissions: PermissionString[]; + /** + * The permissions required for the client + * @type {PermissionString[]} + */ + clientPermissions: PermissionString[]; + /** + * Aliases of the Message command + * @type {string[] | undefined} + */ + aliases?: string[]; + /** + * Cooldowns collection + * @type {Collection>} + */ + cooldowns: Collection>; + /** + * The + * @type {CommandsManager} + */ + manager?: CommandsManager; + /** + * Constructor for build a Command + * @param {ShewenyClient} client Client framework + * @param {CommandData} data Data for build a Command + */ + constructor(client: ShewenyClient, data: CommandData); + /** + * This function is executed before executing the `execute` function + * @param {CommandInteraction | ContextMenuInteraction | Message} interaction Interaction + * @returns {any | Promise} + */ + before?(interaction: CommandInteraction | ContextMenuInteraction | Message): any | Promise; + onAutocomplete?(interaction: AutocompleteInteraction): any | Promise; + /** + * Main function `execute` for the commands + * @param {CommandInteraction | ContextMenuInteraction | Message} interaction Interaction + * @param {CommandMessageArgsResolved[]} [args] Arguments of the Message command + * @returns {any | Promise} + */ + abstract execute(interaction: CommandInteraction | ContextMenuInteraction | Message, args?: CommandMessageArgsResolved[]): //args?: CommandMessageArgsResolved + any | Promise; + /** + * Unregister a command from collections + * @returns {boolean} + */ + unregister(): boolean; + /** + * Reload a command + * @returns {Promise | null>} The Application Commands collection + */ + reload(): Promise | null>; + /** + * Register a command in collections + * @returns {Collection} The Application Commands collection + */ + register(): Promise>; + private isType; +} diff --git a/typings/structures/Event.d.ts b/typings/structures/Event.d.ts index 94819d51..2abfc9b3 100644 --- a/typings/structures/Event.d.ts +++ b/typings/structures/Event.d.ts @@ -1,67 +1,67 @@ -/// -import { Collection } from 'discord.js'; -import { BaseStructure } from '.'; -import type { EventEmitter } from 'events'; -import type { ShewenyClient } from '../client/Client'; -import type { EventOptions } from '../typescript/interfaces'; -import type { EventsManager } from '..'; -/** - * Represents an Event structure - * @extends {BaseStructure} - */ -export declare abstract class Event extends BaseStructure { - /** - * Description of a event - * @type {string} - */ - description: string; - /** - * Set the emitter of the event - * @type {Emitter} - */ - emitter: EventEmitter; - /** - * The - * @type {EventsManager} - */ - manager?: EventsManager; - /** - * Name of a event - * @type {string} - */ - name: string; - /** - * If the listener is deleted after it is executed - * @type {boolean} - */ - once: boolean; - /** - * Constructor for build a Event - * @param {ShewenyClient} client Client framework - * @param {string} name Name of the event - * @param {string[]} customId Custom id for one or more buttons - */ - constructor(client: ShewenyClient, name: string, options?: EventOptions); - before?(...args: any[]): any | Promise; - abstract execute(...args: any[]): any | Promise; - /** - * Unregister an event - * @public - * @returns {boolean} - */ - unregister(): boolean; - /** - * Reload an event - * @public - * @async - * @returns {Promise | null>} The events collection - */ - reload(): Promise | null>; - /** - * Register an event - * @public - * @async - * @returns {Promise>} The events collection - */ - register(): Promise>; -} +/// +import { Collection } from 'discord.js'; +import { BaseStructure } from '.'; +import type { EventEmitter } from 'events'; +import type { ShewenyClient } from '../client/Client'; +import type { EventOptions } from '../typescript/interfaces'; +import type { EventsManager } from '..'; +/** + * Represents an Event structure + * @extends {BaseStructure} + */ +export declare abstract class Event extends BaseStructure { + /** + * Description of a event + * @type {string} + */ + description: string; + /** + * Set the emitter of the event + * @type {Emitter} + */ + emitter: EventEmitter; + /** + * The + * @type {EventsManager} + */ + manager?: EventsManager; + /** + * Name of a event + * @type {string} + */ + name: string; + /** + * If the listener is deleted after it is executed + * @type {boolean} + */ + once: boolean; + /** + * Constructor for build a Event + * @param {ShewenyClient} client Client framework + * @param {string} name Name of the event + * @param {string[]} customId Custom id for one or more buttons + */ + constructor(client: ShewenyClient, name: string, options?: EventOptions); + before?(...args: any[]): any | Promise; + abstract execute(...args: any[]): any | Promise; + /** + * Unregister an event + * @public + * @returns {boolean} + */ + unregister(): boolean; + /** + * Reload an event + * @public + * @async + * @returns {Promise | null>} The events collection + */ + reload(): Promise | null>; + /** + * Register an event + * @public + * @async + * @returns {Promise>} The events collection + */ + register(): Promise>; +} diff --git a/typings/structures/Inhibitor.d.ts b/typings/structures/Inhibitor.d.ts index 0cce54bb..485ca8c5 100644 --- a/typings/structures/Inhibitor.d.ts +++ b/typings/structures/Inhibitor.d.ts @@ -1,71 +1,71 @@ -import { Collection } from 'discord.js'; -import { BaseStructure } from '.'; -import type { InhibitorsManager } from '..'; -import type { ShewenyClient } from '../client/Client'; -import type { InhibitorType } from '../typescript/types'; -import type { Interaction, Message } from 'discord.js'; -interface InhibitorOptions { - type?: InhibitorType[]; - priority?: number; -} -/** - * Represents an Command structure - * @extends {BaseStructure} - */ -export declare abstract class Inhibitor extends BaseStructure { - /** - * The - * @type {InhibitorsManager} - */ - manager?: InhibitorsManager; - /** - * Name of a inhibitor - * @type {string} - */ - name: string; - /** - * Priority of a inhibitor - * @type {number} - */ - priority: number; - /** - * Type(s) of a inhibitor - * @type {InhibitorType[]} - */ - type: InhibitorType[]; - /** - * Constructor for build a Inhibitor - * @param {ShewenyClient} client Client framework - * @param {string} name Name of the event - * @param {InhibitorOptions} [options] Options for the inhibitor - */ - constructor(client: ShewenyClient, name: string, options?: InhibitorOptions); - /** - * This function is executed when the main `execute` function has failed - * @param {any[]} args Arguments - * @returns {any | Promise} - */ - abstract onFailure(client: ShewenyClient, ctx: Interaction | Message): any | Promise; - /** - * Main function `execute` for the inhibitors - * @param {any[]} args Button interaction - * @returns {any | Promise} - */ - abstract execute(client: ShewenyClient, ctx: Interaction | Message): any | Promise; - /** - * Unregister a inhibitor from collections - * @returns {boolean} - */ - unregister(): boolean; - /** - * Reload a inhibitor - * @returns {Promise | null>} The inhibitors collection - */ - reload(): Promise | null>; - /** - * Register a inhibitor in collections - * @returns {Collection} The inhibitors collection - */ - register(): Promise>; -} -export {}; +import { Collection } from 'discord.js'; +import { BaseStructure } from '.'; +import type { InhibitorsManager } from '..'; +import type { ShewenyClient } from '../client/Client'; +import type { InhibitorType } from '../typescript/types'; +import type { Interaction, Message } from 'discord.js'; +interface InhibitorOptions { + type?: InhibitorType[]; + priority?: number; +} +/** + * Represents an Command structure + * @extends {BaseStructure} + */ +export declare abstract class Inhibitor extends BaseStructure { + /** + * The + * @type {InhibitorsManager} + */ + manager?: InhibitorsManager; + /** + * Name of a inhibitor + * @type {string} + */ + name: string; + /** + * Priority of a inhibitor + * @type {number} + */ + priority: number; + /** + * Type(s) of a inhibitor + * @type {InhibitorType[]} + */ + type: InhibitorType[]; + /** + * Constructor for build a Inhibitor + * @param {ShewenyClient} client Client framework + * @param {string} name Name of the event + * @param {InhibitorOptions} [options] Options for the inhibitor + */ + constructor(client: ShewenyClient, name: string, options?: InhibitorOptions); + /** + * This function is executed when the main `execute` function has failed + * @param {any[]} args Arguments + * @returns {any | Promise} + */ + abstract onFailure(client: ShewenyClient, ctx: Interaction | Message): any | Promise; + /** + * Main function `execute` for the inhibitors + * @param {any[]} args Button interaction + * @returns {any | Promise} + */ + abstract execute(client: ShewenyClient, ctx: Interaction | Message): any | Promise; + /** + * Unregister a inhibitor from collections + * @returns {boolean} + */ + unregister(): boolean; + /** + * Reload a inhibitor + * @returns {Promise | null>} The inhibitors collection + */ + reload(): Promise | null>; + /** + * Register a inhibitor in collections + * @returns {Collection} The inhibitors collection + */ + register(): Promise>; +} +export {}; diff --git a/typings/structures/SelectMenu.d.ts b/typings/structures/SelectMenu.d.ts index 647edbc5..5ea4d54f 100644 --- a/typings/structures/SelectMenu.d.ts +++ b/typings/structures/SelectMenu.d.ts @@ -1,60 +1,60 @@ -import { Collection } from 'discord.js'; -import { BaseStructure } from '.'; -import type { SelectMenuInteraction } from 'discord.js'; -import type { ShewenyClient } from '../client/Client'; -import type { SelectMenusManager } from '..'; -import { SelectMenuData } from '../typescript/interfaces'; -/** - * Represents an Select Menu structure - * @extends {BaseStructure} - */ -export declare abstract class SelectMenu extends BaseStructure { - /** - * Cooldown of a command in seconds - * @type {number} - */ - cooldown: number; - /** - * Custom id for one or more select menus - * @type {string[] | RegExp[]} - */ - customId: string[] | RegExp[]; - /** - * The - * @type {SelectMenusManager} - */ - manager?: SelectMenusManager; - /** - * Constructor for build a Select Menu - * @param {ShewenyClient} client Client framework - * @param {string[] | RegExp[]} customId Custom id for one or more select menus - */ - constructor(client: ShewenyClient, customId: string[] | RegExp[], data?: SelectMenuData); - /** - * This function is executed before executing the `execute` function - * @param {SelectMenuInteraction} interaction Select Menu interaction - * @returns {any | Promise} - */ - before?(interaction: SelectMenuInteraction): any | Promise; - /** - * Main function `execute` for the select menus - * @param {SelectMenuInteraction} interaction Select Menus interaction - * @returns {any | Promise} - */ - abstract execute(interaction: SelectMenuInteraction): any | Promise; - /** - * Unregister a select menu from collections - * @returns {boolean} - */ - unregister(): boolean; - /** - * Reload a select menu - * @returns {Promise | null>} The select menus collection - */ - reload(): Promise | null>; - /** - * Register a select menu in collections - * @returns {Collection} The select menus collection - */ - register(): Promise>; -} +import { Collection } from 'discord.js'; +import { BaseStructure } from '.'; +import type { SelectMenuInteraction } from 'discord.js'; +import type { ShewenyClient } from '../client/Client'; +import type { SelectMenusManager } from '..'; +import { SelectMenuData } from '../typescript/interfaces'; +/** + * Represents an Select Menu structure + * @extends {BaseStructure} + */ +export declare abstract class SelectMenu extends BaseStructure { + /** + * Cooldown of a command in seconds + * @type {number} + */ + cooldown: number; + /** + * Custom id for one or more select menus + * @type {string[] | RegExp[]} + */ + customId: string[] | RegExp[]; + /** + * The + * @type {SelectMenusManager} + */ + manager?: SelectMenusManager; + /** + * Constructor for build a Select Menu + * @param {ShewenyClient} client Client framework + * @param {string[] | RegExp[]} customId Custom id for one or more select menus + */ + constructor(client: ShewenyClient, customId: string[] | RegExp[], data?: SelectMenuData); + /** + * This function is executed before executing the `execute` function + * @param {SelectMenuInteraction} interaction Select Menu interaction + * @returns {any | Promise} + */ + before?(interaction: SelectMenuInteraction): any | Promise; + /** + * Main function `execute` for the select menus + * @param {SelectMenuInteraction} interaction Select Menus interaction + * @returns {any | Promise} + */ + abstract execute(interaction: SelectMenuInteraction): any | Promise; + /** + * Unregister a select menu from collections + * @returns {boolean} + */ + unregister(): boolean; + /** + * Reload a select menu + * @returns {Promise | null>} The select menus collection + */ + reload(): Promise | null>; + /** + * Register a select menu in collections + * @returns {Collection} The select menus collection + */ + register(): Promise>; +} diff --git a/typings/structures/index.d.ts b/typings/structures/index.d.ts index b7054874..68522f48 100644 --- a/typings/structures/index.d.ts +++ b/typings/structures/index.d.ts @@ -1,6 +1,6 @@ -export { BaseStructure } from "./BaseStructure"; -export { Button } from "./Button"; -export { Command } from "./Command"; -export { Event } from "./Event"; -export { Inhibitor } from "./Inhibitor"; -export { SelectMenu } from "./SelectMenu"; +export { BaseStructure } from "./BaseStructure"; +export { Button } from "./Button"; +export { Command } from "./Command"; +export { Event } from "./Event"; +export { Inhibitor } from "./Inhibitor"; +export { SelectMenu } from "./SelectMenu"; diff --git a/typings/typescript/interfaces.d.ts b/typings/typescript/interfaces.d.ts index 69b774eb..9eee36f0 100644 --- a/typings/typescript/interfaces.d.ts +++ b/typings/typescript/interfaces.d.ts @@ -1,187 +1,187 @@ -/// -import type { ApplicationCommandOptionData, PermissionString, Collection } from 'discord.js'; -import type { EventEmitter } from 'events'; -import type { ClientOptions, Snowflake } from 'discord.js'; -import type { ButtonsManager, CommandsManager, EventsManager, InhibitorsManager, SelectMenusManager } from '../managers'; -import type { Button, Command, Event, Inhibitor, SelectMenu } from '../structures'; -import type { CLIENT_MODE, COMMAND_CHANNEL, COMMAND_MESSAGE_ARGS_TYPE, COMMAND_TYPE, INHIBITOR_TYPE } from '../constants/constants'; -/** - * Interfaces of managers - */ -export interface BaseManagerOptions { - directory: string; - loadAll?: boolean; -} -export interface ButtonsManagerOptions extends BaseManagerOptions { - cooldown?: number; -} -export interface SelectMenusManagerOptions extends BaseManagerOptions { - cooldown?: number; -} -export interface CommandsManagerOptions extends BaseManagerOptions { - guildId?: Snowflake | Snowflake[]; - prefix?: string; - applicationPermissions?: boolean; - autoRegisterApplicationCommands?: boolean; - default?: CommandsManagerDefaultOptions; -} -export interface ButtonsManagerDefaultOptions { - cooldown?: number; -} -export interface SelectMenusManagerDefaultOptions { - cooldown?: number; -} -export interface CommandsManagerDefaultOptions { - adminOnly?: boolean; - category?: string; - channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; - clientPermissions?: PermissionString[]; - cooldown?: number; - examples?: string | string[]; - type?: typeof COMMAND_TYPE.cmdSlash | typeof COMMAND_TYPE.cmdMsg | typeof COMMAND_TYPE.ctxMsg | typeof COMMAND_TYPE.ctxUser; - usage?: string | string[]; - userPermissions?: PermissionString[]; -} -export interface EventsManagerOptions extends BaseManagerOptions { - default?: EventsManagerDefaultOptions; -} -export interface EventsManagerDefaultOptions { - emitter?: EventEmitter; - once?: boolean; -} -export interface InhibitorsManagerOptions extends BaseManagerOptions { - default?: InhibitorsManagerDefaultOptions; -} -export interface InhibitorsManagerDefaultOptions { - priority?: number; - type?: typeof INHIBITOR_TYPE.message[] | typeof INHIBITOR_TYPE.appCommand[] | typeof INHIBITOR_TYPE.button[] | typeof INHIBITOR_TYPE.select[] | typeof INHIBITOR_TYPE.all[]; -} -/** - * Intrefaces of Commands - */ -export interface SlashCommandData { - name: string; - type?: typeof COMMAND_TYPE.cmdSlash; - description: string; - options?: ApplicationCommandOptionData[]; - defaultPermission?: boolean; - category?: string; - usage?: string | string[]; - examples?: string | string[]; - channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; - cooldown?: number; - adminsOnly?: boolean; - userPermissions?: PermissionString[]; - clientPermissions?: PermissionString[]; -} -export interface ContextMenuUserData { - name: string; - type?: typeof COMMAND_TYPE.ctxUser; - description?: string; - defaultPermission?: boolean; - category?: string; - usage?: string | string[]; - examples?: string | string[]; - channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; - cooldown?: number; - adminsOnly?: boolean; - userPermissions?: PermissionString[]; - clientPermissions?: PermissionString[]; -} -export interface ContextMenuMessageData { - name: string; - type?: typeof COMMAND_TYPE.ctxMsg; - description?: string; - defaultPermission?: boolean; - category?: string; - usage?: string | string[]; - examples?: string | string[]; - channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; - cooldown?: number; - adminsOnly?: boolean; - userPermissions?: PermissionString[]; - clientPermissions?: PermissionString[]; -} -export interface MessageData { - name: string; - type?: typeof COMMAND_TYPE.cmdMsg; - args?: MessageCommandOptionData[]; - description?: string; - category?: string; - usage?: string | string[]; - examples?: string | string[]; - channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; - cooldown?: number; - adminsOnly?: boolean; - userPermissions?: PermissionString[]; - clientPermissions?: PermissionString[]; - aliases?: string[]; -} -export interface MessageCommandOptionData { - name: string; - type: typeof COMMAND_MESSAGE_ARGS_TYPE.string | typeof COMMAND_MESSAGE_ARGS_TYPE.number | typeof COMMAND_MESSAGE_ARGS_TYPE.boolean | typeof COMMAND_MESSAGE_ARGS_TYPE.rest | typeof COMMAND_MESSAGE_ARGS_TYPE.guild | typeof COMMAND_MESSAGE_ARGS_TYPE.channel | typeof COMMAND_MESSAGE_ARGS_TYPE.member | typeof COMMAND_MESSAGE_ARGS_TYPE.guild_emoji | typeof COMMAND_MESSAGE_ARGS_TYPE.role | typeof COMMAND_MESSAGE_ARGS_TYPE.user; - default?: any; -} -export interface CommandMessageArgsResolved { - [index: string]: any; -} -/** - * Interfaces of events - */ -export interface EventOptions { - description?: string; - emitter?: EventEmitter; - once?: boolean; -} -/** - * Other interfaces - */ -export interface ButtonData { - cooldown?: number; -} -export interface SelectMenuData { - cooldown?: number; -} -/** - * Client interfaces - */ -export interface ShewenyClientOptions extends ClientOptions { - mode?: typeof CLIENT_MODE.dev | typeof CLIENT_MODE.prod; - admins?: Snowflake[]; - managers?: ManagersOptions; - joinThreadsOnCreate?: boolean; -} -export interface Managers { - commands?: CommandsManager; - events?: EventsManager; - buttons?: ButtonsManager; - selectMenus?: SelectMenusManager; - inhibitors?: InhibitorsManager; -} -export interface ManagersCollections { - commands: Collection; - events: Collection; - buttons: Collection; - selectMenus: Collection; - inhibitors: Collection; -} -export interface Cooldowns { - commands: Collection>; - buttons: Collection>; - selectMenus: Collection>; -} -interface ManagersOptions { - commands?: CommandsManagerOptions; - events?: EventsManagerOptions; - buttons?: BaseManagerOptions; - selectMenus?: BaseManagerOptions; - inhibitors?: InhibitorsManagerOptions; -} -/** - * loadFiles function - */ -export interface LoadFilesOptions { - directory: string; - key: string; -} -export {}; +/// +import type { ApplicationCommandOptionData, PermissionString, Collection } from 'discord.js'; +import type { EventEmitter } from 'events'; +import type { ClientOptions, Snowflake } from 'discord.js'; +import type { ButtonsManager, CommandsManager, EventsManager, InhibitorsManager, SelectMenusManager } from '../managers'; +import type { Button, Command, Event, Inhibitor, SelectMenu } from '../structures'; +import type { CLIENT_MODE, COMMAND_CHANNEL, COMMAND_MESSAGE_ARGS_TYPE, COMMAND_TYPE, INHIBITOR_TYPE } from '../constants/constants'; +/** + * Interfaces of managers + */ +export interface BaseManagerOptions { + directory: string; + loadAll?: boolean; +} +export interface ButtonsManagerOptions extends BaseManagerOptions { + cooldown?: number; +} +export interface SelectMenusManagerOptions extends BaseManagerOptions { + cooldown?: number; +} +export interface CommandsManagerOptions extends BaseManagerOptions { + guildId?: Snowflake | Snowflake[]; + prefix?: string; + applicationPermissions?: boolean; + autoRegisterApplicationCommands?: boolean; + default?: CommandsManagerDefaultOptions; +} +export interface ButtonsManagerDefaultOptions { + cooldown?: number; +} +export interface SelectMenusManagerDefaultOptions { + cooldown?: number; +} +export interface CommandsManagerDefaultOptions { + adminOnly?: boolean; + category?: string; + channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; + clientPermissions?: PermissionString[]; + cooldown?: number; + examples?: string | string[]; + type?: typeof COMMAND_TYPE.cmdSlash | typeof COMMAND_TYPE.cmdMsg | typeof COMMAND_TYPE.ctxMsg | typeof COMMAND_TYPE.ctxUser; + usage?: string | string[]; + userPermissions?: PermissionString[]; +} +export interface EventsManagerOptions extends BaseManagerOptions { + default?: EventsManagerDefaultOptions; +} +export interface EventsManagerDefaultOptions { + emitter?: EventEmitter; + once?: boolean; +} +export interface InhibitorsManagerOptions extends BaseManagerOptions { + default?: InhibitorsManagerDefaultOptions; +} +export interface InhibitorsManagerDefaultOptions { + priority?: number; + type?: typeof INHIBITOR_TYPE.message[] | typeof INHIBITOR_TYPE.appCommand[] | typeof INHIBITOR_TYPE.button[] | typeof INHIBITOR_TYPE.select[] | typeof INHIBITOR_TYPE.all[]; +} +/** + * Intrefaces of Commands + */ +export interface SlashCommandData { + name: string; + type?: typeof COMMAND_TYPE.cmdSlash; + description: string; + options?: ApplicationCommandOptionData[]; + defaultPermission?: boolean; + category?: string; + usage?: string | string[]; + examples?: string | string[]; + channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; + cooldown?: number; + adminsOnly?: boolean; + userPermissions?: PermissionString[]; + clientPermissions?: PermissionString[]; +} +export interface ContextMenuUserData { + name: string; + type?: typeof COMMAND_TYPE.ctxUser; + description?: string; + defaultPermission?: boolean; + category?: string; + usage?: string | string[]; + examples?: string | string[]; + channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; + cooldown?: number; + adminsOnly?: boolean; + userPermissions?: PermissionString[]; + clientPermissions?: PermissionString[]; +} +export interface ContextMenuMessageData { + name: string; + type?: typeof COMMAND_TYPE.ctxMsg; + description?: string; + defaultPermission?: boolean; + category?: string; + usage?: string | string[]; + examples?: string | string[]; + channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; + cooldown?: number; + adminsOnly?: boolean; + userPermissions?: PermissionString[]; + clientPermissions?: PermissionString[]; +} +export interface MessageData { + name: string; + type?: typeof COMMAND_TYPE.cmdMsg; + args?: MessageCommandOptionData[]; + description?: string; + category?: string; + usage?: string | string[]; + examples?: string | string[]; + channel?: typeof COMMAND_CHANNEL.dm | typeof COMMAND_CHANNEL.guild; + cooldown?: number; + adminsOnly?: boolean; + userPermissions?: PermissionString[]; + clientPermissions?: PermissionString[]; + aliases?: string[]; +} +export interface MessageCommandOptionData { + name: string; + type: typeof COMMAND_MESSAGE_ARGS_TYPE.string | typeof COMMAND_MESSAGE_ARGS_TYPE.number | typeof COMMAND_MESSAGE_ARGS_TYPE.boolean | typeof COMMAND_MESSAGE_ARGS_TYPE.rest | typeof COMMAND_MESSAGE_ARGS_TYPE.guild | typeof COMMAND_MESSAGE_ARGS_TYPE.channel | typeof COMMAND_MESSAGE_ARGS_TYPE.member | typeof COMMAND_MESSAGE_ARGS_TYPE.guild_emoji | typeof COMMAND_MESSAGE_ARGS_TYPE.role | typeof COMMAND_MESSAGE_ARGS_TYPE.user; + default?: any; +} +export interface CommandMessageArgsResolved { + [index: string]: any; +} +/** + * Interfaces of events + */ +export interface EventOptions { + description?: string; + emitter?: EventEmitter; + once?: boolean; +} +/** + * Other interfaces + */ +export interface ButtonData { + cooldown?: number; +} +export interface SelectMenuData { + cooldown?: number; +} +/** + * Client interfaces + */ +export interface ShewenyClientOptions extends ClientOptions { + mode?: typeof CLIENT_MODE.dev | typeof CLIENT_MODE.prod; + admins?: Snowflake[]; + managers?: ManagersOptions; + joinThreadsOnCreate?: boolean; +} +export interface Managers { + commands?: CommandsManager; + events?: EventsManager; + buttons?: ButtonsManager; + selectMenus?: SelectMenusManager; + inhibitors?: InhibitorsManager; +} +export interface ManagersCollections { + commands: Collection; + events: Collection; + buttons: Collection; + selectMenus: Collection; + inhibitors: Collection; +} +export interface Cooldowns { + commands: Collection>; + buttons: Collection>; + selectMenus: Collection>; +} +interface ManagersOptions { + commands?: CommandsManagerOptions; + events?: EventsManagerOptions; + buttons?: BaseManagerOptions; + selectMenus?: BaseManagerOptions; + inhibitors?: InhibitorsManagerOptions; +} +/** + * loadFiles function + */ +export interface LoadFilesOptions { + directory: string; + key: string; +} +export {}; diff --git a/typings/typescript/types.d.ts b/typings/typescript/types.d.ts index 74ffd8f1..d6d8cb7e 100644 --- a/typings/typescript/types.d.ts +++ b/typings/typescript/types.d.ts @@ -1,11 +1,11 @@ -import type { SlashCommandData, ContextMenuMessageData, ContextMenuUserData, MessageData } from './interfaces'; -import type { COMMAND_TYPE, INHIBITOR_TYPE } from '../constants/constants'; -/** - * Commands types - */ -export declare type CommandData = SlashCommandData | ContextMenuUserData | ContextMenuMessageData | MessageData; -export declare type CommandType = typeof COMMAND_TYPE.cmdSlash | typeof COMMAND_TYPE.ctxMsg | typeof COMMAND_TYPE.ctxUser | typeof COMMAND_TYPE.cmdMsg; -/** - * Inhibitors types - */ -export declare type InhibitorType = typeof INHIBITOR_TYPE.message | typeof INHIBITOR_TYPE.appCommand | typeof INHIBITOR_TYPE.button | typeof INHIBITOR_TYPE.select | typeof INHIBITOR_TYPE.all; +import type { SlashCommandData, ContextMenuMessageData, ContextMenuUserData, MessageData } from './interfaces'; +import type { COMMAND_TYPE, INHIBITOR_TYPE } from '../constants/constants'; +/** + * Commands types + */ +export declare type CommandData = SlashCommandData | ContextMenuUserData | ContextMenuMessageData | MessageData; +export declare type CommandType = typeof COMMAND_TYPE.cmdSlash | typeof COMMAND_TYPE.ctxMsg | typeof COMMAND_TYPE.ctxUser | typeof COMMAND_TYPE.cmdMsg; +/** + * Inhibitors types + */ +export declare type InhibitorType = typeof INHIBITOR_TYPE.message | typeof INHIBITOR_TYPE.appCommand | typeof INHIBITOR_TYPE.button | typeof INHIBITOR_TYPE.select | typeof INHIBITOR_TYPE.all; diff --git a/typings/utils/client-util.d.ts b/typings/utils/client-util.d.ts index 75105b9c..f49a005a 100644 --- a/typings/utils/client-util.d.ts +++ b/typings/utils/client-util.d.ts @@ -1,4 +1,4 @@ -import { Intents } from 'discord.js'; -import type { PartialTypes } from 'discord.js'; -export declare function getAllIntents(): Intents; -export declare function getAllPartials(): PartialTypes[]; +import { Intents } from 'discord.js'; +import type { PartialTypes } from 'discord.js'; +export declare function getAllIntents(): Intents; +export declare function getAllPartials(): PartialTypes[]; diff --git a/typings/utils/loadFiles.d.ts b/typings/utils/loadFiles.d.ts index b4962063..7e75ab01 100644 --- a/typings/utils/loadFiles.d.ts +++ b/typings/utils/loadFiles.d.ts @@ -1,4 +1,4 @@ -import { Collection } from 'discord.js'; -import type { ShewenyClient } from '../client/Client'; -import type { LoadFilesOptions } from '../typescript/interfaces'; -export declare function loadFiles(client: ShewenyClient, options: LoadFilesOptions): Promise | undefined>; +import { Collection } from 'discord.js'; +import type { ShewenyClient } from '../client/Client'; +import type { LoadFilesOptions } from '../typescript/interfaces'; +export declare function loadFiles(client: ShewenyClient, options: LoadFilesOptions): Promise | undefined>; diff --git a/typings/utils/readDirFiles.d.ts b/typings/utils/readDirFiles.d.ts index 5e5208d1..75d44e96 100644 --- a/typings/utils/readDirFiles.d.ts +++ b/typings/utils/readDirFiles.d.ts @@ -1 +1 @@ -export declare function readDirAndPush(d: string): Promise; +export declare function readDirAndPush(d: string): Promise;