Archived
moved and renamed CommandMessageStructure
This commit is contained in:
1 parent
0ec0eb985b
commit
6ab0874a1a
3 files changed
+8
-7
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -89,9 +89,4 @@ export interface ChatCommandInit {
|
||||
) => CommandFunctionReturnTypes;
|
||||
}
|
||||
|
||||
export interface CommandMessageStructure {
|
||||
command: BaseCommand;
|
||||
parameters: InputParameter[];
|
||||
}
|
||||
|
||||
export type GetMode = "ALL" | "PREFIX" | "NO_PREFIX";
|
||||
@@ -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> = 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[];
|
||||
}
|
||||
Reference in new issue
Block a user