feat: locales #27
1 changed files with 6 additions and 5 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue