mirror of https://github.com/thaldrin/thaldrin.git
move a whole lot around
This commit is contained in:
parent
fffcc65b13
commit
48f03092ef
|
@ -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"
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
||||
}
|
||||
}
|
|
@ -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) }
|
|
@ -1 +1 @@
|
|||
Subproject commit a5498cbc6748b4238672fea5f2cf926b2a03bd28
|
||||
Subproject commit c13845e8406bd862cdef290414a56044f17918fb
|
|
@ -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"
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue