From 6ab0874a1aaf73e57fa6bf55b57e76b70791a1f1 Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Tue, 7 Sep 2021 18:43:32 +0200 Subject: [PATCH] moved and renamed CommandMessageStructure --- src/managers/ChatCommandManager.ts | 4 ++-- src/types/ChatCommand.ts | 5 ----- src/types/commands.ts | 6 ++++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/managers/ChatCommandManager.ts b/src/managers/ChatCommandManager.ts index bf00e76..744e1ed 100644 --- a/src/managers/ChatCommandManager.ts +++ b/src/managers/ChatCommandManager.ts @@ -1,7 +1,7 @@ import { CommandInteraction, Message } from "discord.js"; import { CommandNotFound, MissingParameterError } from "../errors"; import { BooleanParameter, InputParameter, NullParameter, NumberParameter, ObjectParameter, Parameter, StringParameter } from "../structures/Parameter.js"; -import { CommandMessageStructure as ChatCommandInteractionData } from "../types/ChatCommand.js"; +import { CommandInteractionData } from "../types/commands.js"; import { ChatCommand } from "../structures/ChatCommand.js"; import { CommandManager } from "./CommandManager.js"; import { ParameterResolvable } from "../types/Parameter.js"; @@ -65,7 +65,7 @@ export class ChatCommandManager extends CommandManager { } } - public fetch(i: Message | CommandInteraction): ChatCommandInteractionData | null { + public fetch(i: Message | CommandInteraction): CommandInteractionData | null { if (i instanceof Message) { if (!this.prefix || i.author.bot || !i.content.startsWith(this.prefix)) return null; else { diff --git a/src/types/ChatCommand.ts b/src/types/ChatCommand.ts index 4852a0e..e795310 100644 --- a/src/types/ChatCommand.ts +++ b/src/types/ChatCommand.ts @@ -89,9 +89,4 @@ export interface ChatCommandInit { ) => CommandFunctionReturnTypes; } -export interface CommandMessageStructure { - command: BaseCommand; - parameters: InputParameter[]; -} - export type GetMode = "ALL" | "PREFIX" | "NO_PREFIX"; diff --git a/src/types/commands.ts b/src/types/commands.ts index 60663a1..67ec60b 100644 --- a/src/types/commands.ts +++ b/src/types/commands.ts @@ -2,7 +2,13 @@ import { BaseCommand } from "../structures/BaseCommand.js"; import { ChatCommand } from "../structures/ChatCommand.js"; import { MessageCommand } from "../structures/MessageCommand.js"; import { UserCommand } from "../structures/UserCommand.js"; +import { InputParameter } from "../structures/Parameter.js"; export type CommandStructure = T extends "MESSAGE" ? MessageCommand : T extends "USER" ? UserCommand : T extends "CHAT" ? ChatCommand : BaseCommand; export type CommandResolvable = BaseCommand | ChatCommand | MessageCommand | UserCommand; + +export interface CommandInteractionData { + command: BaseCommand; + parameters: InputParameter[]; +}