mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Sort by name in help/gen commands
This commit is contained in:
@@ -46,7 +46,7 @@ module.exports = class HelpCommand extends Command {
|
||||
if (cmd.ownerOnly || cmd.hidden) return false;
|
||||
if (cmd.nsfw && !msg.channel.nsfw) return false;
|
||||
return true;
|
||||
});
|
||||
}).sort((a, b) => a.name.localeCompare(b.name));
|
||||
if (!commands.size) continue;
|
||||
cmdCount += commands.size;
|
||||
if (i > (embedIndex * 10) + 10) embedIndex++;
|
||||
|
||||
@@ -17,7 +17,9 @@ module.exports = class GenerateCommandsCommand extends Command {
|
||||
async run(msg) {
|
||||
const list = this.client.registry.groups
|
||||
.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;
|
||||
const mapped = commands.map(c => {
|
||||
const nsfw = c.nsfw ? ` (NSFW)` : '';
|
||||
|
||||
@@ -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 list = this.client.registry.groups
|
||||
.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;
|
||||
return commands.map(c => {
|
||||
const credits = c.credit
|
||||
|
||||
Reference in New Issue
Block a user