Fixed /skip for smaller calls

This commit is contained in:
TiddyT 2022-05-17 14:01:34 -05:00
parent d46bb83e5e
commit 9ae1db1b80

View file

@ -134,13 +134,13 @@ public class MusicCommand extends CommandClass {
e.getHook().sendMessage("\u26A0 You've already voted to skip this song!").queue();
} else {
int votes = info.getSkips();
int size = info.getAuthor().getVoiceState().getChannel().getMembers().size() - 1;
if (votes >= (size/2)) { // Skips when half the channel votes
int required = Math.round((info.getAuthor().getVoiceState().getChannel().getMembers().size() - 1) / 2); // Determines required amount of votes
if (votes >= (required)){
getPlayer(e.getGuild()).stopTrack();
e.getHook().sendMessage("\u23E9 Skipping current track.").queue();
} else {
info.addSkip(e.getUser());
e.getHook().sendMessage("**" + e.getUser().getName() + "** voted to skip the track. [" + (votes + 1) + "/" + (size/2) + "]").queue();
e.getHook().sendMessage("**" + e.getUser().getName() + "** voted to skip the track. [" + (votes + 1) + "/" + (required) + "]").queue();
}
}
}