v3.3.3: Paged Commands #20

Merged
voidf1sh merged 15 commits from v3.3.3 into main 2024-09-26 13:24:55 +00:00
Showing only changes of commit 8148890574 - Show all commits

View File

@ -185,10 +185,11 @@ const functions = {
const slashCommandsMap = interaction.client.slashCommands.map(e => { const slashCommandsMap = interaction.client.slashCommands.map(e => {
if (!slashSeenNames.includes(e.data.name)) { if (!slashSeenNames.includes(e.data.name)) {
slashSeenNames.push(e.data.name); slashSeenNames.push(e.data.name);
return { const command = {
name: e.data.name, name: e.data.name,
description: e.data.description description: e.data.description
}; };
return command;
} else { } else {
return null; return null;
} }
@ -204,18 +205,29 @@ const functions = {
const dotCommandsMap = interaction.client.dotCommands.map(e => { const dotCommandsMap = interaction.client.dotCommands.map(e => {
if (!dotSeenNames.includes(e.name)) { if (!dotSeenNames.includes(e.name)) {
dotSeenNames.push(e.name); dotSeenNames.push(e.name);
return { let command = {
name: e.name, name: e.name,
description: e.description, description: e.description,
usage: e.usage 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 { } else {
return null; return null;
} }
}); });
for (const e of dotCommandsMap) { for (const e of dotCommandsMap) {
if (e != null) { 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); console.log(dotCommandsFields);