client.on('message', message => {
while(turn < maxturn) {
console.log(turn)
if (!battle_status) return;
if (message.author.id != member.id) return;
if (own_magic.indexOf(message.content) != -1 && message.author.id == member.id) {```
If own_magic not include message.content, gonna return.
i want just 1 return.. but gonna infinite loop started
#Loop error on client.on
8 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
bc you're using while
also turn is clearly not even being greater than maxturn so that will go on forever.
You should also use messageCreate and not message