Update help

This commit is contained in:
Declan Chidlow 2024-07-12 17:19:31 +08:00
parent e1f5927e89
commit a74def6812

View file

@ -11,23 +11,23 @@ const categories: { [key in CommandCategory]: {
[CommandCategory.Moderation]: { [CommandCategory.Moderation]: {
friendlyName: 'Moderation', friendlyName: 'Moderation',
description: 'Moderation-focused commands', description: 'Moderation-focused commands',
aliases: [ 'mod', 'mods' ], aliases: [ 'mod' ],
}, },
[CommandCategory.Config]: { [CommandCategory.Config]: {
friendlyName: 'Configuration', friendlyName: 'Configuration',
description: 'Configure AutoMod', description: 'Configure AutoMod',
aliases: [ 'conf', 'config' ], aliases: [ 'conf', 'config' ],
}, },
[CommandCategory.Misc]: {
friendlyName: 'Misc',
description: 'Random stuff :yed:',
aliases: [ 'miscellaneous', 'weirdwordicantspell' ],
},
[CommandCategory.Owner]: { [CommandCategory.Owner]: {
friendlyName: 'Owner', friendlyName: 'Owner',
description: 'Owner-only commands for managing AutoMod', description: 'Owner-only commands for managing AutoMod',
aliases: [], aliases: [],
}, },
[CommandCategory.Miscellaneous]: {
friendlyName: 'Miscellaneous',
description: 'Assorted extras',
aliases: [ 'misc' ],
},
[CommandCategory.None]: { [CommandCategory.None]: {
friendlyName: 'Uncategorized', friendlyName: 'Uncategorized',
description: 'Uncategorized commands', description: 'Uncategorized commands',
@ -40,17 +40,17 @@ export default {
aliases: null, aliases: null,
description: 'Help command.', description: 'Help command.',
removeEmptyArgs: true, removeEmptyArgs: true,
category: CommandCategory.Misc, category: CommandCategory.Miscellaneous,
run: async (message: MessageCommandContext, args: string[]) => { run: async (message: MessageCommandContext, args: string[]) => {
const isBotOwner = ownerIDs.includes(message.authorId!); const isBotOwner = ownerIDs.includes(message.authorId!);
const prefix = DEFAULT_PREFIX; // TODO: fetch prefix from server config const prefix = DEFAULT_PREFIX; // TODO: fetch prefix from server config
let searchInput = args.shift()?.toLowerCase(); let searchInput = args.shift()?.toLowerCase();
if (!searchInput) { if (!searchInput) {
let msg = `## AutoMod help\n` + let msg = `## AutoMod Help\n` +
`Type **${prefix}help [category]** to view see all commands or **${prefix}help [command]** to learn more about a command.\n\n` `Type **${prefix}help [category]** to view see all commands or **${prefix}help [command]** to learn more about a command.\n\n`
+ `### [Open Server Settings]` + `### [Open Server Settings]`
+ `(<${process.env.WEB_UI_URL || 'https://automod.janderedev.xyz'}/dashboard/${message.channel?.serverId}>)\n\n`; + `(<${process.env.WEB_UI_URL || 'https://automod.vale.rocks'}/dashboard/${message.channel?.serverId}>)\n\n`;
let total = 0; let total = 0;
@ -79,7 +79,7 @@ export default {
c => c[1].aliases.find(k => k.toLowerCase() == searchInput) c => c[1].aliases.find(k => k.toLowerCase() == searchInput)
) || []; ) || [];
if (category && !searchInput.startsWith(prefix)) { if (category && !searchInput.startsWith(prefix)) {
let msg = `**AutoMod help** - Category: ${category.friendlyName}\n` let msg = `**AutoMod Help** - Category: ${category.friendlyName}\n`
+ `${category.description}\n\n` + `${category.description}\n\n`
+ `Type **${prefix}help [command]** to learn more about a command.\n\n`; + `Type **${prefix}help [command]** to learn more about a command.\n\n`;
@ -103,7 +103,7 @@ export default {
if (!cmd) { if (!cmd) {
return message.reply(`I can't find any command or category matching \`${searchInput}\`.`); return message.reply(`I can't find any command or category matching \`${searchInput}\`.`);
} else { } else {
let msg = `**AutoMod help** - Command: ${cmd.name}\n` let msg = `**AutoMod Help** - Command: ${cmd.name}\n`
+ `${cmd.description}\n\n`; + `${cmd.description}\n\n`;
if (cmd.syntax) msg += `Syntax: \`${cmd.syntax}\`\n`; if (cmd.syntax) msg += `Syntax: \`${cmd.syntax}\`\n`;