small command changes

This commit is contained in:
Lio Young 2021-05-10 17:22:52 +02:00
parent cb8a157588
commit 4df2e5da62
No known key found for this signature in database
GPG Key ID: 789795A11879E169
5 changed files with 23 additions and 10 deletions

View File

@ -13,11 +13,11 @@ export default class Command {
hidden: boolean;
usage: string
constructor(command: CommandContext) {
this.name = command.name || "";
this.description = command.description || "";
this.name = command.name || "generic";
this.description = command.description || "generic command base";
this.aliases = command.aliases || [];
this.module = command.module || "";
this.cooldown = command.cooldown || 0;
this.cooldown = command.cooldown || 1;
this.guild = command.guild || false;
this.dev = command.dev || false;
this.nsfw = command.nsfw || false;

View File

@ -25,19 +25,31 @@ export = class Help extends Command {
// @ts-ignore
return 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)
})
embed.setTitle("Help")
embed.setTitle(`${ctx.config.variables.name} Help`)
return ctx.channel.send(embed)
}
let arg = ctx.args[0]
if (await (await Folders()).includes(arg)) {
if (arg === 'developer') return
let commands = await (await Commands(arg, ctx.client)).map(command => `\`${command.name}\` - ${command.description}`)
embed.addField("Commands", commands.join("\n"))
// @ts-ignore
embed.setTitle(`${lingua[ctx.settings.locale].CATEGORIES[arg.toUpperCase()].name || arg}`)
// @ts-ignore
embed.setDescription(`${lingua[ctx.settings.locale].CATEGORIES[arg.toUpperCase()].desc || ""}\n\nTotal Commands: **${commands.length}**`)
return ctx.channel.send(embed)
}
// @ts-ignore
let command = ctx.client.commands.find((c) => c.name.toLowerCase() == arg || (c.aliases && c.aliases.includes(arg)))
// let aliases = ctx.client.commands.filter()
if (command) {
embed.setTitle("Command Help")
if (command.aliases?.length !== 0) embed.addField("Aliases", `\`${command.aliases?.join("`\n⇒`")}\``, true)
// @ts-ignore
embed.setDescription(`**Cooldown:** ${command.cooldown}s\n**Module:** ${lingua[ctx.settings.locale].CATEGORIES[command.module.toUpperCase()].name || command.module}\n**NSFW:** ${command.nsfw}`)
embed.addField("Usage", `\`thal ${command.name}\` ${command.usage}`, true)
ctx.channel.send(embed)
}
}
}

View File

@ -9,7 +9,8 @@ export = class E621 extends Command {
name: "e621",
description: "Get an Image from E621",
aliases: ['e6', 'esix'],
cooldown: 2
cooldown: 2,
nsfw: true
})
}

@ -1 +1 @@
Subproject commit 6ef3be5f4e4600ed920f3aed83393cbd9ec6533f
Subproject commit e6ba2d38b0b2c9d2e5ba2b0e5379a9a6178daa1b

View File

@ -11,8 +11,8 @@ export default {
/**
* Discord ID of the Developer
*/
// id: "318044130796109825", // Lio
id: "3180441307961098255", // Lio
id: "318044130796109825", // Lio
// id: "3180441307961098255", // Lio
link: "https://kji.tf/twitter"
}
],