feat: locales #27

Merged
Anri merged 26 commits from lang into main 2022-07-22 11:46:48 +02:00
Showing only changes of commit 2776048d33 - Show all commits

View file

@ -3,9 +3,14 @@ import { Client, CommandInteraction, Message } from 'discord.js';
import { getLocale } from '../../utils/locales';
export default {
data: (client: Client) => new SlashCommandBuilder()
.setNameLocalizations(getLocale(client, 'c_ping_name'))
.setDescriptionLocalizations(getLocale(client, 'c_ping_desc')),
data: (client: Client) => {
const path = __filename.split('/');
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'));
},
interaction: async (interaction: CommandInteraction, client: Client) => {
const loc = client.locales.get(interaction.locale) ?? client.locales.get(client.config.default_lang);