aboutsummaryrefslogtreecommitdiff
path: root/Commands/status.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-02-15 20:19:36 -0500
committerAndrew Lee <alee14498@protonmail.com>2024-02-15 20:19:36 -0500
commit891cf0ecdad9a1a78fdf5d127a60bdcc8e54ae5c (patch)
tree645affdddeadca3a470a0d8385d28d7d09696a53 /Commands/status.js
parentec7a6d2cd4b0d25251d5e9691a148a2b07984509 (diff)
downloadDLAP-891cf0ecdad9a1a78fdf5d127a60bdcc8e54ae5c.tar.gz
DLAP-891cf0ecdad9a1a78fdf5d127a60bdcc8e54ae5c.tar.bz2
DLAP-891cf0ecdad9a1a78fdf5d127a60bdcc8e54ae5c.zip
Deploy command changes; Filter bots on vote; Fixed status
Diffstat (limited to 'Commands/status.js')
-rw-r--r--Commands/status.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/Commands/status.js b/Commands/status.js
index d762187..fcc6c08 100644
--- a/Commands/status.js
+++ b/Commands/status.js
@@ -40,10 +40,10 @@ export default {
// Get the members of the voice channel who have not voted yet
const voiceChannel = interaction.member.voice.channel;
- const members = voiceChannel.members.filter(m => !votes.has(m.id));
+ const members = voiceChannel.members.filter(m => !votes.has(m.id) && !m.user.bot);
// Calculate the number of votes required to skip the audio track
- const votesRequired = Math.ceil((members.size - votes.size) / 2);
+ const votesRequired = Math.ceil(members.size / 2);
if (audioID >= files.length) {
audioName = t('playlistDone');
@@ -52,12 +52,10 @@ export default {
if (!metadataEmpty) {
try {
const { common } = await parseFile('music/' + audioName);
- audioName = common.title;
+ audioName = common.title ? common.title : audioName.split('.').slice(0, -1).join('.');
} catch (error) {
console.error(error.message);
}
- } else {
- audioName = audioName.split('.').slice(0, -1).join('.');
}
}