feat: help command #36

Merged
Anri merged 23 commits from help into main 2022-07-25 00:54:19 +02:00
Showing only changes of commit b3d8755b7d - Show all commits

View file

@ -7,16 +7,24 @@ export default {
data: (client: Client) => { data: (client: Client) => {
const filename = getFilename(__filename); const filename = getFilename(__filename);
return new SlashCommandBuilder() return new SlashCommandBuilder()
.setName(filename.toLowerCase()) .setName(
.setDescription(client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? '') filename.toLowerCase())
.setNameLocalizations(getLocalizations(client, `c_${filename}_name`, true)) .setDescription(client.locales.get(client.config.default_lang)
.setDescriptionLocalizations(getLocalizations(client, `c_${filename}_desc`)); ?.get(`c_${filename}_desc`) ?? '')
.setNameLocalizations(
getLocalizations(client, `c_${filename}_name`, true))
.setDescriptionLocalizations(
getLocalizations(client, `c_${filename}_desc`)
);
}, },
interaction: async (interaction: CommandInteraction, client: Client) => { interaction: async (interaction: CommandInteraction, client: Client) => {
const loc = getLocale(client, interaction.locale); const loc = getLocale(client, interaction.locale);
const sent = await interaction.reply({ content: 'Pinging...', fetchReply: true }) as Message; const sent = await interaction.reply({
content: 'Pinging...',
fetchReply: true,
}) as Message;
interaction.editReply( interaction.editReply(
`${loc?.get('c_ping1')}: \ `${loc?.get('c_ping1')}: \