Draechen
Draechen
DIAdiscord.js - Imagine an app
Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
Good afternoon! I apologize if this isn't the correct forum for my question, but my bot seems to be going offline after one particular command has been triggered. It processes through the on message create, posts the message in the channel (along with sending a couple of DMs to the users who triggered that command), but then it hangs and goes offline without any error message or anything indicating a problem. Here is the section where everything occurs:
const startReadyCheckSequence = (vote, client) => { message = "\n It's time to vote! Reply !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(Sending message to ${user.username}`) user.send({content: message}) }) sendMessageToVoteChannel(client,mentionUsers(vote) + message) vote.ready = true console.log ("BEFORE SET TIMEOUT") setTimeout(removeNotReadyUsers, 300000, vote, client) };
and here is the command parser section that calls it:
}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)
45 replies