diff --git a/index.ts b/index.ts index b2302e3..7e3fdcb 100644 --- a/index.ts +++ b/index.ts @@ -1,12 +1,12 @@ import { MessageEmbed } from "discord.js"; -import { Bot } from "./src/Bot.js"; -import { Command } from "./src/Command.js"; +import { Bot } from "./src/structures/Bot.js"; +import { Command } from "./src/structures/Command.js"; import { InitOptions } from "./src/types/Bot.js"; import { CommandBuilder, CommandMessageStructure } from "./src/types/Command.js"; import { HelpMessageParams } from "./src/types/HelpMessage.js"; import { ParameterResolvable, ParameterType, ParameterSchema } from "./src/types/Parameter.js"; import { SystemMessageAppearance, SystemMessageData } from "./src/types/SystemMessage.js"; -import { ObjectID, InputParameter, StringParameter, BooleanParameter, NumberParameter, ObjectParameter, Parameter } from "./src/Parameter.js"; +import { ObjectID, InputParameter, StringParameter, BooleanParameter, NumberParameter, ObjectParameter, Parameter } from "./src/structures/Parameter.js"; import { PermissionsError, ParameterTypeError, MissingParameterError, OperationSuccess } from "./src/errors.js"; export default Bot; diff --git a/src/errors.ts b/src/errors.ts index b7d2b17..d92c11b 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,6 +1,6 @@ -import { Command } from "./Command.js"; +import { Command } from "./structures/Command.js"; import { GuildMember } from "discord.js"; -import { Parameter } from "./Parameter.js"; +import { Parameter } from "./structures/Parameter.js"; import { ParameterType } from "./types/Parameter.js"; /** diff --git a/src/global/state.ts b/src/global/state.ts deleted file mode 100644 index 06c3f4d..0000000 --- a/src/global/state.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { StateManager } from "../StateManager.js"; - -export const applicationState = new StateManager(); diff --git a/src/CommandManager.ts b/src/managers/CommandManager.ts similarity index 97% rename from src/CommandManager.ts rename to src/managers/CommandManager.ts index 844e989..56ff78f 100644 --- a/src/CommandManager.ts +++ b/src/managers/CommandManager.ts @@ -1,9 +1,9 @@ import { CommandInteraction, Message } from "discord.js"; -import { MissingParameterError } from "./errors.js"; -import { BooleanParameter, InputParameter, NumberParameter, ObjectParameter, StringParameter } from "./Parameter.js"; -import { Command } from "./Command.js"; -import { CommandMessageStructure, PhraseOccurrenceData } from "./types/Command.js"; -import { applicationState } from "./global/state.js"; +import { MissingParameterError } from "../errors.js"; +import { BooleanParameter, InputParameter, NumberParameter, ObjectParameter, StringParameter } from "../structures/Parameter.js"; +import { Command } from "../structures/Command.js"; +import { CommandMessageStructure, PhraseOccurrenceData } from "../types/Command.js"; +import { applicationState } from "../state.js"; /** * @class Command manager diff --git a/src/StateManager.ts b/src/managers/StateManager.ts similarity index 100% rename from src/StateManager.ts rename to src/managers/StateManager.ts diff --git a/src/SystemMessage.ts b/src/managers/SystemMessage.ts similarity index 99% rename from src/SystemMessage.ts rename to src/managers/SystemMessage.ts index 6813636..a9b9dd4 100644 --- a/src/SystemMessage.ts +++ b/src/managers/SystemMessage.ts @@ -1,5 +1,5 @@ import { CommandInteraction, Message, MessageEmbed } from "discord.js"; -import { SystemMessageAppearance, SystemMessageData, MessageType } from "./types/SystemMessage"; +import { SystemMessageAppearance, SystemMessageData, MessageType } from "../types/SystemMessage.js"; export class SystemMessageManager { /** diff --git a/src/state.ts b/src/state.ts new file mode 100644 index 0000000..ef2da3f --- /dev/null +++ b/src/state.ts @@ -0,0 +1,3 @@ +import { StateManager } from "./managers/StateManager.js"; + +export const applicationState = new StateManager(); diff --git a/src/Bot.ts b/src/structures/Bot.ts similarity index 96% rename from src/Bot.ts rename to src/structures/Bot.ts index f019e1a..ee821e8 100644 --- a/src/Bot.ts +++ b/src/structures/Bot.ts @@ -3,14 +3,14 @@ import { Client, CommandInteraction, GuildMember, Intents, Message } from "disco import { EventEmitter } from "events"; import * as http from "http"; import { Command } from "./Command.js"; -import { CommandManager } from "./CommandManager.js"; -import { OperationSuccess, PermissionsError } from "./errors.js"; +import { CommandManager } from "../managers/CommandManager.js"; +import { OperationSuccess, PermissionsError } from "../errors.js"; import { HelpMessage } from "./Help.js"; -import { SystemMessageManager } from "./SystemMessage.js"; -import { CommandMessageStructure } from "./types/Command.js"; -import { InitOptions } from "./types/Bot.js"; -import { HelpMessageParams } from "./types/HelpMessage.js"; -import { applicationState } from "./global/state.js"; +import { SystemMessageManager } from "../managers/SystemMessage.js"; +import { CommandMessageStructure } from "../types/Command.js"; +import { InitOptions } from "../types/Bot.js"; +import { HelpMessageParams } from "../types/HelpMessage.js"; +import { applicationState } from "../state.js"; export declare interface Bot { on(event: "READY", listener: Function): this; diff --git a/src/Command.ts b/src/structures/Command.ts similarity index 97% rename from src/Command.ts rename to src/structures/Command.ts index 2922b66..64d2ee8 100644 --- a/src/Command.ts +++ b/src/structures/Command.ts @@ -1,8 +1,8 @@ import { Permissions, Message, MessageEmbed, CommandInteraction, GuildMember, ReplyMessageOptions, PermissionResolvable } from "discord.js"; -import { CommandBuilder } from "./types/Command.js"; -import { ParameterResolvable } from "./types/Parameter.js"; -import { PermissionCheckTypes } from "./types/permissions.js"; -import { OperationSuccess, PermissionsError } from "./errors.js"; +import { CommandBuilder } from "../types/Command.js"; +import { ParameterResolvable } from "../types/Parameter.js"; +import { PermissionCheckTypes } from "../types/permissions.js"; +import { OperationSuccess, PermissionsError } from "../errors.js"; import { DefaultParameter, InputParameter, Parameter } from "./Parameter.js"; /** diff --git a/src/Help.ts b/src/structures/Help.ts similarity index 96% rename from src/Help.ts rename to src/structures/Help.ts index 8a0aee4..8eafe36 100644 --- a/src/Help.ts +++ b/src/structures/Help.ts @@ -1,7 +1,7 @@ import { MessageEmbed } from "discord.js"; import { Command } from "./Command.js"; -import { CommandManager } from "./CommandManager.js"; -import { HelpMessageParams } from "./types/HelpMessage.js"; +import { CommandManager } from "../managers/CommandManager.js"; +import { HelpMessageParams } from "../types/HelpMessage.js"; export class HelpMessage extends Command { constructor(cmdManager: CommandManager, params: HelpMessageParams, botName?: string) { diff --git a/src/Parameter.ts b/src/structures/Parameter.ts similarity index 99% rename from src/Parameter.ts rename to src/structures/Parameter.ts index bf61536..4abd287 100644 --- a/src/Parameter.ts +++ b/src/structures/Parameter.ts @@ -1,5 +1,5 @@ import { CategoryChannel, Guild, GuildMember, NewsChannel, Role, StageChannel, StoreChannel, TextChannel, VoiceChannel } from "discord.js"; -import { ParameterType, ParameterResolvable, ParameterSchema } from "./types/Parameter.js"; +import { ParameterType, ParameterResolvable, ParameterSchema } from "../types/Parameter.js"; /** * @class Representation of command parameter diff --git a/src/types/Command.ts b/src/types/Command.ts index fd86eca..990fcf8 100644 --- a/src/types/Command.ts +++ b/src/types/Command.ts @@ -1,7 +1,7 @@ import { CommandInteraction, ReplyMessageOptions, PermissionResolvable, Message, MessageEmbed } from "discord.js"; import { ParameterSchema, ParameterResolvable } from "./Parameter.js"; -import { InputParameter } from "../Parameter.js"; -import { Command } from "../Command.js"; +import { InputParameter } from "../structures/Parameter.js"; +import { Command } from "../structures/Command.js"; import { PermissionCheckTypes } from "./permissions.js"; /** diff --git a/src/types/Parameter.ts b/src/types/Parameter.ts index 9b4fd8b..04af67b 100644 --- a/src/types/Parameter.ts +++ b/src/types/Parameter.ts @@ -1,4 +1,4 @@ -import { ObjectID } from "../Parameter.js"; +import { ObjectID } from "../structures/Parameter.js"; export type ParameterType = "string" | "boolean" | "number" | "user" | "role" | "channel" | "mentionable"; diff --git a/src/types/SystemMessage.ts b/src/types/SystemMessage.ts index 071d7a8..f6cc5cf 100644 --- a/src/types/SystemMessage.ts +++ b/src/types/SystemMessage.ts @@ -1,5 +1,5 @@ import { ColorResolvable, GuildMember, User } from "discord.js"; -import { Command } from "../Command.js"; +import { Command } from "../structures/Command.js"; import { PermissionsError } from "../errors.js"; /**