I've got a stranage error and don't know what to do.

So, I was building a Discord bot in JavaScript. The bot was pretty long and had more than 1000 lignes of code. When running it after some time to see if everything's good, I got a strange error and my new commands that I added wouldn't work.
Here is the error:

(node:1452) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit

Would appreciate any help, thanks! ;)

You are viewing a single comment. View All

You added a client.on function for every single command. That isn't allowed -- you should only have one.

Put all your code inside one client.on like this:


@Coder100 I did it. It works!The only one that still won't respond is 'atatA' near the end.


@naneandreimihne you made command lowercase so the equality will never be true.