wip: debug fk
This commit is contained in:
parent
fc7a49faff
commit
1d1d4d2ba3
34
index.js
34
index.js
@ -377,7 +377,9 @@ client.on("interactionCreate", async (interaction) => {
|
||||
// get members in voice channel
|
||||
const addupPlayers = Array.from(addup.members.values());
|
||||
if (addupPlayers.length === 0 && pickingPlayers.length <= 18) {
|
||||
return await interaction.followUp("Found no players in addup and picking has 18 or fewer players");
|
||||
return await interaction.followUp(
|
||||
"Found no players in addup and picking has 18 or fewer players"
|
||||
);
|
||||
}
|
||||
const pickingPlayers = Array.from(picking.members.values());
|
||||
if (pickingPlayers.length === 0) {
|
||||
@ -387,12 +389,16 @@ client.on("interactionCreate", async (interaction) => {
|
||||
let fatkids = [];
|
||||
|
||||
// select excess players to be sat out
|
||||
console.log(pickingPlayers.length, addupPlayers.length, pickingPlayers.length + addupPlayers.length)
|
||||
console.log(
|
||||
pickingPlayers.length,
|
||||
addupPlayers.length,
|
||||
pickingPlayers.length + addupPlayers.length
|
||||
);
|
||||
|
||||
while (pickingPlayers.length + addupPlayers.length > 18) {
|
||||
const idx = Math.floor(Math.random() * pickingPlayers.length);
|
||||
let fk = await pickingPlayers.splice(idx, 1)[0];
|
||||
console.log(getApplicableName(fk))
|
||||
console.log(getApplicableName(fk));
|
||||
fatkids.push(fk);
|
||||
}
|
||||
|
||||
@ -440,24 +446,26 @@ client.on("interactionCreate", async (interaction) => {
|
||||
);
|
||||
|
||||
// get members in voice channel
|
||||
const addupPlayers = Array.from(addup.members.values());
|
||||
if (addupPlayers.length === 0 && pickingPlayers.length <= 2) {
|
||||
return await interaction.followUp("Found no players in addup and picking has 18 or fewer players");
|
||||
}
|
||||
const pickingPlayers = Array.from(picking.members.values());
|
||||
if (pickingPlayers.length === 0) {
|
||||
return await interaction.followUp("Found no players in picking");
|
||||
}
|
||||
//const addupPlayers = Array.from(addup.members.values());
|
||||
//const pickingPlayers = Array.from(picking.members.values());
|
||||
const addupPlayers = [];
|
||||
const pickingPlayers = [];
|
||||
addup.members.forEach((member) => addupPlayers.push(member));
|
||||
picking.members.forEach((member) => pickingPlayers.push(member));
|
||||
|
||||
let fatkids = [];
|
||||
|
||||
// select excess players to be sat out
|
||||
console.log(pickingPlayers.length, addupPlayers.length, pickingPlayers.length + addupPlayers.length)
|
||||
console.log(
|
||||
pickingPlayers.length,
|
||||
addupPlayers.length,
|
||||
pickingPlayers.length + addupPlayers.length
|
||||
);
|
||||
|
||||
while (pickingPlayers.length + addupPlayers.length > 2) {
|
||||
const idx = Math.floor(Math.random() * pickingPlayers.length);
|
||||
let fk = await pickingPlayers.splice(idx, 1)[0];
|
||||
console.log(getApplicableName(fk))
|
||||
console.log(getApplicableName(fk));
|
||||
fatkids.push(fk);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user