diff --git a/package.json b/package.json index 0895b88..0dca45a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "tsc", "start": "node build/shard.js", - "dev": "npm run build && npm run start", + "dev": "nodemon --ignore \"./build\" -e js,ts --exec \"npm run build && npm run start\"", "init": "npm run subs:init && npm run subs:update", "subs:init": "git submodule init && git submodule update", "subs:update": "git submodule update --remote" diff --git a/src/handler/client/Client.ts b/src/handler/client/Client.ts index 0efa01f..89ae390 100755 --- a/src/handler/client/Client.ts +++ b/src/handler/client/Client.ts @@ -56,7 +56,7 @@ export default class Thaldrin extends Client { // Logger.info({ // type: "command:loaded", // command: Command.name, - // message: `${Command.name} was loaded` + // message: `${Command.name}:${Command.module} was loaded` // }) this.commands.set(Command.name, Command); } catch (err) { diff --git a/src/modules/images/birb.ts b/src/modules/animals/birb.ts similarity index 100% rename from src/modules/images/birb.ts rename to src/modules/animals/birb.ts diff --git a/src/modules/images/cat.ts b/src/modules/animals/cat.ts similarity index 100% rename from src/modules/images/cat.ts rename to src/modules/animals/cat.ts diff --git a/src/modules/images/fox.ts b/src/modules/animals/fox.ts similarity index 100% rename from src/modules/images/fox.ts rename to src/modules/animals/fox.ts diff --git a/src/modules/images/hyena.ts b/src/modules/animals/hyena.ts similarity index 100% rename from src/modules/images/hyena.ts rename to src/modules/animals/hyena.ts diff --git a/src/modules/images/shibe.ts b/src/modules/animals/shibe.ts similarity index 100% rename from src/modules/images/shibe.ts rename to src/modules/animals/shibe.ts diff --git a/src/modules/images/wolf.ts b/src/modules/animals/wolf.ts similarity index 100% rename from src/modules/images/wolf.ts rename to src/modules/animals/wolf.ts diff --git a/src/modules/general/help.ts b/src/modules/general/help.ts new file mode 100644 index 0000000..6908ed9 --- /dev/null +++ b/src/modules/general/help.ts @@ -0,0 +1,32 @@ +import Command from '../../handler/structures/Command'; +import { Context } from '../../utils/types'; +import lingua from '../../utils/lingua'; +import { Folders, Commands } from "../../utils/command.amount"; +import embed from '../../utils/embed'; +export = class Help extends Command { + constructor() { + super({ + name: "help", + aliases: ['?', 'h'], + description: "Get help with the Bot", + cooldown: 1, + }) + } + + // ? [ 'developer', 'general', 'images', 'misc', 'roleplay' ] + + async command(ctx: Context) { + if (ctx.args.length === 0) { + embed.setTitle("Help") + await (await Folders()).forEach(async folder => { + if (!ctx.isDeveloper && folder === 'developer') return + // @ts-ignore + embed.addField(`${lingua[ctx.settings.locale].CATEGORIES[folder.toUpperCase()].name || folder} [\`${[...(await Commands(folder, ctx.client))].length}\`]`, `\`${ctx.config.variables.prefix[2]} help ${folder}\``, true) + }) + return ctx.channel.send(embed) + } + + ctx.channel.send(embed) + + } +} \ No newline at end of file diff --git a/src/modules/images/e926.ts b/src/modules/misc/e926.ts similarity index 100% rename from src/modules/images/e926.ts rename to src/modules/misc/e926.ts diff --git a/src/modules/images/e621.ts b/src/modules/nsfw/e621.ts similarity index 100% rename from src/modules/images/e621.ts rename to src/modules/nsfw/e621.ts diff --git a/src/utils/command.amount.ts b/src/utils/command.amount.ts new file mode 100644 index 0000000..bc0ae36 --- /dev/null +++ b/src/utils/command.amount.ts @@ -0,0 +1,5 @@ +import path from "path" +import { readdirSync as read } from "fs" +import Thaldrin from '../handler/client/Client' +export async function Folders() { return await read(path.join(__dirname, '../modules')) } +export async function Commands(module: string, Thaldrin: Thaldrin) { return Thaldrin.commands.filter(command => command.module === module) } \ No newline at end of file diff --git a/src/utils/lingua b/src/utils/lingua index a5498cb..c13845e 160000 --- a/src/utils/lingua +++ b/src/utils/lingua @@ -1 +1 @@ -Subproject commit a5498cbc6748b4238672fea5f2cf926b2a03bd28 +Subproject commit c13845e8406bd862cdef290414a56044f17918fb diff --git a/variables.ts b/variables.ts index 6efc4aa..0c70408 100644 --- a/variables.ts +++ b/variables.ts @@ -2,7 +2,7 @@ export default { /** * Default Prefixes */ - prefix: ['thal', "<@434662676547764244>", "<@!434662676547764244>"], + prefix: ["<@434662676547764244>", "<@!434662676547764244>", 'thal'], /** * Developers of the Bot */ @@ -11,7 +11,8 @@ export default { /** * Discord ID of the Developer */ - id: "318044130796109825", // Lio + // id: "318044130796109825", // Lio + id: "3180441307961098255", // Lio link: "https://kji.tf/twitter" } ],