Я делаю что-то, поэтому каждый раз, когда вы реагируете с галочкой, это будет циклически проходить через каждого игрока, уменьшая senter1 каждый раз на 1 Я не получаю ошибки. Я попытался добавить console.log («Эй»), чтобы увидеть, в чем проблема. Все, что он сделал, это просто держал вывод Hey foverever
case 'testerrr':
message.author.sendMessage("Hello, When you are starting please tell me the number of Trainees you are going to train (Trainee - Junior Security) (To cancel enter a the number 1 and press the cancel button next)").then(rdgfdcvgfd => {
rdgfdcvgfd.channel.awaitMessages(response => (response.author === message.author), {
max: 1,
time: 60000000,
errors: ['time']
}).then(collected => {
var senter1 = collected.first();
if (isNaN(senter1)) {
message.channel.sendMessage("Manual ending required as that is not a number")
} else {
function admind(hiii) {
console.log("HEY")
hiii.send("Wow, " + senter1 + ' trainees! That is quite alot.')
hiii.send("Press ✅").then(sentMessage => {
sentMessage.react('✅').then(() => sentMessage.react('❎'));
const filter = (reaction, user) => {
return ['✅', '❎'].includes(reaction.emoji.name) && user.id === message.author.id;
};
sentMessage.awaitReactions(filter, {
max: 1,
time: 60000000,
errors: ['time']
})
.then(collected => {
const reaction1 = collected.first();
if (reaction1.emoji.name === '✅') {
hiii.sendMessage("Took 1 off")
senter1 -= 1
}
})
})
}
do {
admind(message.author)
}
while (senter1 > 0);
message.author.sendMessage("Finished")
}
})
})