Sort by name in help/gen commands

This commit is contained in:
Dragon Fire
2024-04-03 16:38:36 -04:00
parent e5d22f4033
commit 423de7b376
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ module.exports = class HelpCommand extends Command {
if (cmd.ownerOnly || cmd.hidden) return false; if (cmd.ownerOnly || cmd.hidden) return false;
if (cmd.nsfw && !msg.channel.nsfw) return false; if (cmd.nsfw && !msg.channel.nsfw) return false;
return true; return true;
}); }).sort((a, b) => a.name.localeCompare(b.name));
if (!commands.size) continue; if (!commands.size) continue;
cmdCount += commands.size; cmdCount += commands.size;
if (i > (embedIndex * 10) + 10) embedIndex++; if (i > (embedIndex * 10) + 10) embedIndex++;
+3 -1
View File
@@ -17,7 +17,9 @@ module.exports = class GenerateCommandsCommand extends Command {
async run(msg) { async run(msg) {
const list = this.client.registry.groups const list = this.client.registry.groups
.map(g => { .map(g => {
const commands = g.commands.filter(c => !c.hidden && !c.ownerOnly); const commands = g.commands
.filter(c => !c.hidden && !c.ownerOnly)
.sort((a, b) => a.name.localeCompare(b.name));
if (!commands.size) return null; if (!commands.size) return null;
const mapped = commands.map(c => { const mapped = commands.map(c => {
const nsfw = c.nsfw ? ` (NSFW)` : ''; const nsfw = c.nsfw ? ` (NSFW)` : '';
+3 -1
View File
@@ -20,7 +20,9 @@ module.exports = class GenerateCreditCommand extends Command {
const npm = `* ${deps.map(dep => `[${dep}](https://www.npmjs.com/package/${dep})`).join('\n* ')}`; const npm = `* ${deps.map(dep => `[${dep}](https://www.npmjs.com/package/${dep})`).join('\n* ')}`;
const list = this.client.registry.groups const list = this.client.registry.groups
.map(g => { .map(g => {
const commands = g.commands.filter(c => !c.hidden && !c.ownerOnly && c.credit.length - 1 !== 0); const commands = g.commands
.filter(c => !c.hidden && !c.ownerOnly && c.credit.length - 1 !== 0)
.sort((a, b) => a.name.localeCompare(b.name));
if (!commands.size) return null; if (!commands.size) return null;
return commands.map(c => { return commands.map(c => {
const credits = c.credit const credits = c.credit