const startReadyCheckSequence = (vote, client) => {and here is the command parser section that calls it:
message = "\n It's time to vote! ReplySending message to ${user.username}`)!vote yes|no in the channel or respond to the DM with your vote. You have 5min to respond" vote.queue.forEach(user=> {console.log(
user.send({content: message})
})
sendMessageToVoteChannel(client,mentionUsers(vote) + message)
vote.ready = true
console.log ("BEFORE SET TIMEOUT")
setTimeout(removeNotReadyUsers, 300000, vote, client)
};
}else if ( primaryCommand === "join" ){
updateStatus()
if (arguments[0] === undefined){
client.channels.fetch(msgChannelID, true)
.then(channel=> channel.send("Please provide a valid vote code"))
return;
}
if (!VOTE_CODES.includes(arguments[0].toLowerCase())){
client.channels.fetch(msgChannelID, true)
.then(channel=> channel.send("Please provide a valid vote code"))
return;
}
///TODO clean this up
var vote = chosenVote(arguments)
VoteCommands.addToQueue(receivedMessage, vote, client)