From 72ea1090753ccca3c5573801ae0b0a4439e1b736 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 13 Feb 2024 22:35:50 -0500 Subject: Fully working i18n (hopefully); Docker on walkthrough --- bot.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'bot.js') diff --git a/bot.js b/bot.js index e6bd3c0..9376c2a 100644 --- a/bot.js +++ b/bot.js @@ -41,13 +41,13 @@ for (const file of commandFiles) { bot.once(Events.ClientReady, async() => { console.log(t('botReady')); console.log(t('loggedIn', { bot: bot.user.tag })); - console.log(`Running on Discord.JS ${version}`); - console.log(`Voice Channel: ${voiceChannel}`); - console.log(`Status Channel: ${statusChannel}`); - console.log(`DJ Role: ${djRole}`); - console.log(`Owner ID: ${ownerID}`); - console.log(`Shuffle Enabled: ${shuffle}`); - console.log(`Repeat Enabled: ${repeat}`); + console.log(t('discordVersion', { version })); + console.log(t('voiceChannel', { voiceChannel })); + console.log(t('statusChannel', { statusChannel })); + console.log(t('djRole', { djRole })); + console.log(t('ownerID', { ownerID })); + console.log(t('shuffleEnabled', { shuffle })); + console.log(t('repeatEnabled', { repeat })); // Set bots' presence bot.user.setPresence({ @@ -59,16 +59,16 @@ bot.once(Events.ClientReady, async() => { }); const activity = bot.presence.activities[0]; - console.log(`Updated bot presence to "${activity.name}"`); + console.log(t('presenceSet', { activity: activity.name })); // Send bots' status to channel const readyEmbed = new EmbedBuilder() .setAuthor({ name: bot.user.username, iconURL: bot.user.avatarURL() }) - .setDescription('Starting bot...') + .setDescription(t('startingBot')) .setColor('#0066ff'); const channel = bot.channels.cache.get(statusChannel); - if (!channel) return console.error('The status channel does not exist! Skipping.'); + if (!channel) return console.error(t('statusChannelError')); await channel.send({ embeds: [readyEmbed] }); return await voiceInit(bot); @@ -85,6 +85,6 @@ bot.on(Events.InteractionCreate, async interaction => { await command.execute(interaction, bot); } catch (e) { console.error(e); - await interaction.reply({ content: `There was an error while executing this command...\nShare this to the bot owner or report it to the git repository in \`/about\`\n\nDetails:\`\`\`${e}\`\`\``, ephemeral: true }); + await interaction.reply({ content: t('exception', { e }), ephemeral: true }); } }); -- cgit v1.2.3