aboutsummaryrefslogtreecommitdiff
path: root/Commands/status.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-02-13 22:35:50 -0500
committerAndrew Lee <alee14498@protonmail.com>2024-02-13 23:39:19 -0500
commit72ea1090753ccca3c5573801ae0b0a4439e1b736 (patch)
treebb3ff6e00572d111ddc1af0a864df90208c63840 /Commands/status.js
parent3d4f5061d402b44218cdfd351f39317d5f8ecd11 (diff)
downloadDLAP-72ea1090753ccca3c5573801ae0b0a4439e1b736.tar.gz
DLAP-72ea1090753ccca3c5573801ae0b0a4439e1b736.tar.bz2
DLAP-72ea1090753ccca3c5573801ae0b0a4439e1b736.zip
Fully working i18n (hopefully); Docker on walkthrough
Diffstat (limited to 'Commands/status.js')
-rw-r--r--Commands/status.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/Commands/status.js b/Commands/status.js
index aeb909d..d762187 100644
--- a/Commands/status.js
+++ b/Commands/status.js
@@ -22,9 +22,11 @@
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { parseFile } from 'music-metadata';
import { audio, metadataEmpty, duration, audioTitle, currentTrack } from '../AudioBackend/PlayAudio.js';
-import { files, playerState } from '../AudioBackend/AudioControl.js';
+import { files, playerState, playerStatus } from '../AudioBackend/AudioControl.js';
import { votes } from '../Utilities/Voting.js';
+import i18next from '../Utilities/i18n.js';
+const t = i18next.t;
export default {
data: new SlashCommandBuilder()
.setName('status')
@@ -44,7 +46,7 @@ export default {
const votesRequired = Math.ceil((members.size - votes.size) / 2);
if (audioID >= files.length) {
- audioName = 'Playlist Finished';
+ audioName = t('playlistDone');
} else {
audioName = files[audioID];
if (!metadataEmpty) {
@@ -60,25 +62,27 @@ export default {
}
const controlEmbed = new EmbedBuilder()
- .setAuthor({ name: `${bot.user.username} Status`, iconURL: bot.user.avatarURL() })
+ .setAuthor({ name: t('statusTitle', { bot: bot.user.username }), iconURL: bot.user.avatarURL() })
.addFields(
- { name: 'State', value: `${playerState}` },
- { name: 'Tracks', value: `${audioID}/${files.length}` },
- { name: 'Duration', value: `${duration}` },
- { name: 'Votes Needed', value: `${votesRequired}` }
+ { name: t('statusState'), value: `${playerState}` },
+ { name: t('statusTracks'), value: `${audioID}/${files.length}` },
+ { name: t('musicDuration'), value: `${duration}` },
+ { name: t('statusVotesNeeded'), value: `${votesRequired}` }
)
.setColor('#0066ff');
- if (metadataEmpty) {
- controlEmbed.addFields(
- { name: 'Currently Playing', value: `${audio}` },
- { name: 'Up Next', value: `${audioName}` }
- );
- } else {
- controlEmbed.addFields(
- { name: 'Currently Playing', value: `${audioTitle}` },
- { name: 'Up Next', value: `${audioName}` }
- );
+ if (playerStatus === 0 || playerStatus === 1) {
+ if (metadataEmpty) {
+ controlEmbed.addFields(
+ { name: t('currentlyPlaying'), value: `${audio}` },
+ { name: t('upNext'), value: `${audioName}` }
+ );
+ } else {
+ controlEmbed.addFields(
+ { name: t('currentlyPlaying'), value: `${audioTitle}` },
+ { name: t('upNext'), value: `${audioName}` }
+ );
+ }
}
interaction.reply({ embeds: [controlEmbed] });
}