aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-12-20 21:22:04 -0500
committerAndrew Lee <alee14498@protonmail.com>2022-12-20 23:59:21 -0500
commita1eb0704666f613857c7cf87234c1fd485e97942 (patch)
treeeec0ef2dd040418871f51b9fc6c44d9be84547d5
parente5a51721f84503458b1c1597a0776ad521f01c36 (diff)
downloadDLAP-a1eb0704666f613857c7cf87234c1fd485e97942.tar.gz
DLAP-a1eb0704666f613857c7cf87234c1fd485e97942.tar.bz2
DLAP-a1eb0704666f613857c7cf87234c1fd485e97942.zip
Fixes
-rw-r--r--Commands/status.js2
-rw-r--r--Utilities/Voting.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/Commands/status.js b/Commands/status.js
index bf88772..ee6300c 100644
--- a/Commands/status.js
+++ b/Commands/status.js
@@ -65,7 +65,7 @@ export default {
{ name: 'State', value: `${playerState}` },
{ name: 'Tracks', value: `${audioID}/${files.length}` },
{ name: 'Duration', value: `${duration}` },
- { name: 'Votes Needed', value: `${votesRequired}` }
+ { name: 'Votes Needed', value: `${votesRequired - votes.size}` }
)
.setColor('#0066ff');
diff --git a/Utilities/Voting.js b/Utilities/Voting.js
index 2ee0629..ce837d5 100644
--- a/Utilities/Voting.js
+++ b/Utilities/Voting.js
@@ -60,11 +60,11 @@ export async function voteSkip(interaction, bot) {
const members = voiceChannel.members.filter(m => !votes.has(m.id));
// Calculate the number of votes required to skip the audio track
- const votesRequired = Math.ceil(members.size / 2);
+ const votesRequired = Math.ceil((members.size - votes.size) / 2);
// Check if the message author has already voted
if (votes.has(interaction.user.id)) {
- return interaction.reply({ content: `You have already voted, wait ${votesRequired} more vote(s) to skip the audio track`, ephemeral: true });
+ return interaction.reply({ content: `You have already voted, wait ${votesRequired - votes.size} more vote(s) to skip the audio track`, ephemeral: true });
}
// Add the message author to the set of members who have voted