wip: further debug fk

This commit is contained in:
ethanf 2024-01-31 16:29:00 -06:00
parent 1d1d4d2ba3
commit 6857ab9714

View File

@ -452,20 +452,25 @@ client.on("interactionCreate", async (interaction) => {
const pickingPlayers = [];
addup.members.forEach((member) => addupPlayers.push(member));
picking.members.forEach((member) => pickingPlayers.push(member));
if (pickingPlayers.length < addupPlayers.length) {
// move all addup into empty picking
addup.members.forEach((member) => {
member.voice.setChannel(picking);
});
return await interaction.followUp(
"Found too few players in picking to fatkid, moved all addup players to picking instead"
);
}
let fatkids = [];
// select excess players to be sat out
console.log(
pickingPlayers.length,
addupPlayers.length,
pickingPlayers.length + addupPlayers.length
);
while (pickingPlayers.length + addupPlayers.length > 2) {
while (pickingPlayers.length + addupPlayers.length > 3) {
if (pickingPlayers.length === 0) {
return await interaction.followUp("Error: ran out of players in picking to fatkid");
}
const idx = Math.floor(Math.random() * pickingPlayers.length);
let fk = await pickingPlayers.splice(idx, 1)[0];
console.log(getApplicableName(fk));
console.log(fk);
fatkids.push(fk);
}