aboutsummaryrefslogtreecommitdiff
path: root/AudioBackend/Shutdown.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-02-17 00:07:31 -0500
committerGitHub <noreply@github.com>2024-02-17 00:07:31 -0500
commit214a83c0f696ac731c54b00bf7503f87e497afa6 (patch)
tree15d57b08e69d19fb4c2f3effb9937aec8d042bdc /AudioBackend/Shutdown.js
parentb29ab06623fd24cfc2a611bdd658b4d2ef934335 (diff)
parentc848f1d90fef40ffa81915d7dd875a2ee6d6c8d5 (diff)
downloadDLAP-214a83c0f696ac731c54b00bf7503f87e497afa6.tar.gz
DLAP-214a83c0f696ac731c54b00bf7503f87e497afa6.tar.bz2
DLAP-214a83c0f696ac731c54b00bf7503f87e497afa6.zip
Merge pull request #17 from Alee14/testing
Merging testing branch
Diffstat (limited to 'AudioBackend/Shutdown.js')
-rw-r--r--AudioBackend/Shutdown.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/AudioBackend/Shutdown.js b/AudioBackend/Shutdown.js
index fb89505..dcc57f7 100644
--- a/AudioBackend/Shutdown.js
+++ b/AudioBackend/Shutdown.js
@@ -24,12 +24,15 @@ import { updatePlaylist } from './PlayAudio.js';
import { audioState } from './AudioControl.js';
import { readFileSync, writeFile } from 'node:fs';
import { getVoiceConnection, VoiceConnectionStatus } from '@discordjs/voice';
+import i18next from '../Utilities/i18n.js';
+
const { statusChannel, txtFile } = JSON.parse(readFileSync('./config.json', 'utf-8'));
let fileData;
+const t = i18next.t;
export async function destroyAudio(interaction) {
if (txtFile) {
- fileData = 'Now Playing: Nothing';
+ fileData = t('txtNothing');
writeFile('now-playing.txt', fileData, (err) => {
if (err) { console.log(err); }
});
@@ -47,13 +50,13 @@ export async function destroyAudio(interaction) {
export async function stopBot(bot, interaction) {
const statusEmbed = new EmbedBuilder()
.setAuthor({ name: bot.user.username, iconURL: bot.user.avatarURL() })
- .setDescription(`That's all folks! Powering down ${bot.user.username}...`)
+ .setDescription(t('statusShutdown', { bot: bot.user.username }))
.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: [statusEmbed] });
- console.log(`Powering off ${bot.user.username}...`);
+ console.log(t('powerOff', { bot: bot.user.username }));
await destroyAudio(interaction);
await bot.destroy();
return process.exit(0);