wip: further debug fk
This commit is contained in:
parent
1d1d4d2ba3
commit
6857ab9714
23
index.js
23
index.js
@ -452,20 +452,25 @@ client.on("interactionCreate", async (interaction) => {
|
|||||||
const pickingPlayers = [];
|
const pickingPlayers = [];
|
||||||
addup.members.forEach((member) => addupPlayers.push(member));
|
addup.members.forEach((member) => addupPlayers.push(member));
|
||||||
picking.members.forEach((member) => pickingPlayers.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 = [];
|
let fatkids = [];
|
||||||
|
|
||||||
// select excess players to be sat out
|
// select excess players to be sat out
|
||||||
console.log(
|
while (pickingPlayers.length + addupPlayers.length > 3) {
|
||||||
pickingPlayers.length,
|
if (pickingPlayers.length === 0) {
|
||||||
addupPlayers.length,
|
return await interaction.followUp("Error: ran out of players in picking to fatkid");
|
||||||
pickingPlayers.length + addupPlayers.length
|
}
|
||||||
);
|
|
||||||
|
|
||||||
while (pickingPlayers.length + addupPlayers.length > 2) {
|
|
||||||
const idx = Math.floor(Math.random() * pickingPlayers.length);
|
const idx = Math.floor(Math.random() * pickingPlayers.length);
|
||||||
let fk = await pickingPlayers.splice(idx, 1)[0];
|
let fk = await pickingPlayers.splice(idx, 1)[0];
|
||||||
console.log(getApplicableName(fk));
|
console.log(fk);
|
||||||
fatkids.push(fk);
|
fatkids.push(fk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user