diff --git a/src/commands/misc/ping.ts b/src/commands/misc/ping.ts index 4d2e8ff..a995131 100644 --- a/src/commands/misc/ping.ts +++ b/src/commands/misc/ping.ts @@ -1,15 +1,16 @@ import { SlashCommandBuilder } from '@discordjs/builders'; import { Client, CommandInteraction, Message } from 'discord.js'; import { getLocale } from '../../utils/locales'; +import { getFilename } from '../../utils/misc'; export default { data: (client: Client) => { - const path = __filename.split('/'); + const filename = getFilename(__filename); return new SlashCommandBuilder() - .setName(path[path.length - 1].split('.')[0]) - .setDescription(client.locales.get(client.config.default_lang)?.get('c_ping_desc') ?? '?') - .setNameLocalizations(getLocale(client, 'c_ping_name')) - .setDescriptionLocalizations(getLocale(client, 'c_ping_desc')); + .setName(filename) + .setDescription(client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? '?') + .setNameLocalizations(getLocale(client, `c_${filename}_name`)) + .setDescriptionLocalizations(getLocale(client, `c_${filename}_desc`)); }, interaction: async (interaction: CommandInteraction, client: Client) => {