diff --git a/functions.js b/functions.js index f606849..7d8a1b2 100644 --- a/functions.js +++ b/functions.js @@ -185,10 +185,11 @@ const functions = { const slashCommandsMap = interaction.client.slashCommands.map(e => { if (!slashSeenNames.includes(e.data.name)) { slashSeenNames.push(e.data.name); - return { + const command = { name: e.data.name, description: e.data.description }; + return command; } else { return null; } @@ -204,18 +205,29 @@ const functions = { const dotCommandsMap = interaction.client.dotCommands.map(e => { if (!dotSeenNames.includes(e.name)) { dotSeenNames.push(e.name); - return { + let command = { name: e.name, description: e.description, usage: e.usage }; + command.aliasString = new String(); + if (e.alias != undefined && typeof e.alias === 'object') { + for (const a of e.alias) { + command.aliasString += `\`.${a}\`, `; + } + } else if (e.alias != undefined && typeof e.alias === 'string') { + command.aliasString += `\`.${e.alias}\``; + } else { + command.aliasString = 'None'; + } + return command; } else { return null; } }); for (const e of dotCommandsMap) { if (e != null) { - dotCommandsFields.push(`- \`.${e.name}\` - ${e.description} - ${e.usage}`); + dotCommandsFields.push(`- \`.${e.name}\` - ${e.description}\n\tUsage: ${e.usage}\n\tAliases: ${e.aliasString}`); } } console.log(dotCommandsFields);