optimization
This commit is contained in:
parent
a857898300
commit
86c074c7be
3 changed files with 5 additions and 4 deletions
|
@ -32,9 +32,10 @@ export default async (client: Client) => {
|
||||||
).default;
|
).default;
|
||||||
|
|
||||||
// Add it to the collection so the interaction will work
|
// 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);
|
const command = client.commands.list.get(command_name);
|
||||||
let res = `${compteur}- \`${command_name}\` : `;
|
let res = `${compteur}- \`${command_name}\` : `;
|
||||||
if (command?.data) {
|
if (command?.data) {
|
||||||
res += `${command.data(client).description}.\n`;
|
res += `${command.data.description}.\n`;
|
||||||
} else {
|
} else {
|
||||||
res += loc.get('c_help3');
|
res += loc.get('c_help3');
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ declare module 'discord.js' {
|
||||||
/** Command itself */
|
/** Command itself */
|
||||||
{
|
{
|
||||||
/** Data about the command */
|
/** Data about the command */
|
||||||
data(client: Client): SlashCommandBuilder,
|
data: SlashCommandBuilder,
|
||||||
/** How the command interact */
|
/** How the command interact */
|
||||||
interaction: (interaction: CommandInteraction, client: Client) => unknown
|
interaction: (interaction: CommandInteraction, client: Client) => unknown
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue