mirror of https://github.com/thaldrin/thaldrin.git
fix help command
This commit is contained in:
parent
96696ff901
commit
3660503ecc
|
@ -7,7 +7,7 @@ import language from '../../utils/language';
|
||||||
|
|
||||||
function enabled(a: boolean, lang: string) {
|
function enabled(a: boolean, lang: string) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return a ? language.get(lang).misc.enabled : language.get(lang).misc.disabled;
|
return a ? language.get(lang).misc.enabled : language.get(lang).misc.disabled; w
|
||||||
}
|
}
|
||||||
|
|
||||||
export = class Settings extends Command {
|
export = class Settings extends Command {
|
||||||
|
|
|
@ -30,13 +30,13 @@ export = class Help extends Command {
|
||||||
}
|
}
|
||||||
let arg = ctx.args[0]
|
let arg = ctx.args[0]
|
||||||
if (await (await Folders()).includes(arg)) {
|
if (await (await Folders()).includes(arg)) {
|
||||||
if (arg === 'developer') return
|
if (arg === 'developer' && !ctx.isDeveloper) return
|
||||||
let commands = await (await Commands(arg, ctx.client)).map(command => `\`${command.name}\` - ${command.description}`)
|
let commands = await (await Commands(arg, ctx.client)).map(command => `\`${command.name}\` - ${command.description}`)
|
||||||
embed.addField("Commands", commands.join("\n"))
|
embed.addField("Commands", commands.join("\n"))
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
embed.setTitle(`${language.get(ctx.settings.locale).categories[folder.toLowerCase()].name || arg}`)
|
embed.setTitle(`${language.get(ctx.settings.locale).categories[command?.module.toLowerCase()].name || arg}`)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
embed.setDescription(`${language.get(ctx.settings.locale).categories[folder.toLowerCase()].desc || ""}\n\nTotal Commands: **${commands.length}**`)
|
embed.setDescription(`${language.get(ctx.settings.locale).categories[command?.module.toLowerCase()].desc || ""}\n\nTotal Commands: **${commands.length}**`)
|
||||||
return ctx.channel.send(embed)
|
return ctx.channel.send(embed)
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -46,7 +46,7 @@ export = class Help extends Command {
|
||||||
embed.setTitle("Command Help")
|
embed.setTitle("Command Help")
|
||||||
if (command.aliases?.length !== 0) embed.addField("Aliases", `⇒\`${command.aliases?.join("`\n⇒`")}\``, true)
|
if (command.aliases?.length !== 0) embed.addField("Aliases", `⇒\`${command.aliases?.join("`\n⇒`")}\``, true)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
embed.setDescription(`**Cooldown:** ${command.cooldown}s\n**Module:** ${language.get(ctx.settings.locale).categories[folder.toLowerCase()].name || command.module}\n**NSFW:** ${command.nsfw}`)
|
embed.setDescription(`**Cooldown:** ${command.cooldown}s\n**Module:** ${language.get(ctx.settings.locale).categories[command?.module.toLowerCase()].name || command.module}\n**NSFW:** ${command.nsfw}`)
|
||||||
embed.addField("Usage", `\`thal ${command.name}\` ${command.usage}`, true)
|
embed.addField("Usage", `\`thal ${command.name}\` ${command.usage}`, true)
|
||||||
ctx.channel.send(embed)
|
ctx.channel.send(embed)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue