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
|
// get members in voice channel
|
||||||
const addupPlayers = Array.from(addup.members.values());
|
const addupPlayers = Array.from(addup.members.values());
|
||||||
if (addupPlayers.length === 0 && pickingPlayers.length <= 18) {
|
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());
|
const pickingPlayers = Array.from(picking.members.values());
|
||||||
if (pickingPlayers.length === 0) {
|
if (pickingPlayers.length === 0) {
|
||||||
@ -387,12 +389,16 @@ client.on("interactionCreate", async (interaction) => {
|
|||||||
let fatkids = [];
|
let fatkids = [];
|
||||||
|
|
||||||
// select excess players to be sat out
|
// 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) {
|
while (pickingPlayers.length + addupPlayers.length > 18) {
|
||||||
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(getApplicableName(fk));
|
||||||
fatkids.push(fk);
|
fatkids.push(fk);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,24 +446,26 @@ client.on("interactionCreate", async (interaction) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// get members in voice channel
|
// get members in voice channel
|
||||||
const addupPlayers = Array.from(addup.members.values());
|
//const addupPlayers = Array.from(addup.members.values());
|
||||||
if (addupPlayers.length === 0 && pickingPlayers.length <= 2) {
|
//const pickingPlayers = Array.from(picking.members.values());
|
||||||
return await interaction.followUp("Found no players in addup and picking has 18 or fewer players");
|
const addupPlayers = [];
|
||||||
}
|
const pickingPlayers = [];
|
||||||
const pickingPlayers = Array.from(picking.members.values());
|
addup.members.forEach((member) => addupPlayers.push(member));
|
||||||
if (pickingPlayers.length === 0) {
|
picking.members.forEach((member) => pickingPlayers.push(member));
|
||||||
return await interaction.followUp("Found no players in picking");
|
|
||||||
}
|
|
||||||
|
|
||||||
let fatkids = [];
|
let fatkids = [];
|
||||||
|
|
||||||
// select excess players to be sat out
|
// 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) {
|
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(getApplicableName(fk));
|
||||||
fatkids.push(fk);
|
fatkids.push(fk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user