feat: help command #36
3 changed files with 5 additions and 4 deletions
|
@ -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();
|
||||
}),
|
||||
);
|
||||
}),
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue