mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Remove help all
This commit is contained in:
@@ -26,8 +26,7 @@ module.exports = class HelpCommand extends Command {
|
|||||||
async run(msg, args) {
|
async run(msg, args) {
|
||||||
const { command } = args;
|
const { command } = args;
|
||||||
const commands = this.client.registry.findCommands(command, false, msg);
|
const commands = this.client.registry.findCommands(command, false, msg);
|
||||||
const showAll = command && command.toLowerCase() === 'all';
|
if (command) {
|
||||||
if (command && !showAll) {
|
|
||||||
if (commands.length === 1) {
|
if (commands.length === 1) {
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setTitle(`Command ${commands[0].name}`)
|
.setTitle(`Command ${commands[0].name}`)
|
||||||
@@ -49,14 +48,12 @@ module.exports = class HelpCommand extends Command {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setTitle(!showAll ? `Commands Available in ${msg.guild ? msg.guild.name : 'this DM'}` : 'All Commands')
|
.setTitle('Command List')
|
||||||
.setDescription(`Use ${msg.usage('<command>')} to view detailed information about a command.`)
|
.setDescription(`Use ${msg.usage('<command>')} to view detailed information about a command.`)
|
||||||
.setColor(0x00AE86);
|
.setColor(0x00AE86);
|
||||||
for (const group of this.client.registry.groups.values()) {
|
for (const group of this.client.registry.groups.values()) {
|
||||||
embed.addField(`❯ ${group.name}`,
|
embed.addField(`❯ ${group.name}`,
|
||||||
showAll ?
|
group.commands.map((c) => c.name).join(', ') || 'None');
|
||||||
group.commands.map((c) => c.name).join(', ') || 'None' :
|
|
||||||
group.commands.filter((c) => c.isUsable(msg)).map((c) => c.name).join(', ') || 'None');
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await msg.direct({ embed });
|
await msg.direct({ embed });
|
||||||
|
|||||||
Reference in New Issue
Block a user