feat: help command #36

Merged
Anri merged 23 commits from help into main 2022-07-25 00:54:19 +02:00
3 changed files with 5 additions and 4 deletions
Showing only changes of commit 86c074c7be - Show all commits

View file

@ -32,9 +32,10 @@ export default async (client: Client) => {
).default;
// Add it to the collection so the interaction will work
client.commands.list.set(command.data(client).name, command);
command.data = command.data(client);
client.commands.list.set(command.data.name, command);
return command.data(client).toJSON();
return command.data.toJSON();
}),
);
}),

View file

@ -32,7 +32,7 @@ export default {
const command = client.commands.list.get(command_name);
let res = `${compteur}- \`${command_name}\` : `;
if (command?.data) {
res += `${command.data(client).description}.\n`;
res += `${command.data.description}.\n`;
} else {
res += loc.get('c_help3');
}

View file

@ -29,7 +29,7 @@ declare module 'discord.js' {
/** Command itself */
{
/** Data about the command */
data(client: Client): SlashCommandBuilder,
data: SlashCommandBuilder,
/** How the command interact */
interaction: (interaction: CommandInteraction, client: Client) => unknown
}