#Listening an event multiple times

4 messages · Page 1 of 1 (latest)

celest notchBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP
tender pilot
#

The latter, as you risk memory issues with multiple listeners for each event

tender pilot
#

Just search the support channel for where this has been asked and explained. Plenty of people have come in with "11 x listeners detected" and a message asking what to do, and there are explanations of why to use one

lost sage
#

No need to listen a event multiple times, if you use correct statements it is going to be same result. Using multiple listeners for same event can take more space in memory as Mark said, and maybe it can affect performance bad (im not sure about performance difference but there is no advantages of multiple listeners)

Also if you have any project ideas that requires multiple event listeners, we can help you to simplify code into one event.