generic data declaration

This commit is contained in:
Mylloon 2022-07-21 23:01:21 +02:00
parent eb4a022954
commit dcf325c7fc
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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) => {