duplicated interactions
okay i need help, because i have been hititng my head against the wall abt this for days. my interactions keep doubling as per my console logs. for background info:
- there is only one instance being run
- i use an event handler -> separate files for events. other events do not double
- the interactionCreate event is only listened to once
- this applies to every interaction, including buttons (where i noticed this issue)
interactionCreate.js:
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- 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!posted here instead as i feel its a longer issue
how do u know there's only 1 listener for interactionCreate? have u logged
<Client>.listenerCount("interactionCreate")
?yeah, it returns 0 - i know that means unlimited, but this wasn't an issue until after i started working on this new branch. one command defers a reply, but i don't think that would cause this
setting maxListeners to 1 also does not fix the issue
i don't think 0 means unlimited, i think it means u don't have any interactionCreate event listeners added to ur client so you probably logged it before adding the listeners, u should log it wherever u log the interaction type
ah, gotcha. my bad, i assumed it was similar to maxListeners where 0 = unlimited
returns 1 listener for interactionCreate
it also emits the console log twice though :EGGsweat:
:PLUMPblink: i think i fixed it actually...? it seems it was something in my shardingmanager file (main.js)