Interaction emitting 2 times
So basically I have 4 buttons (3 for claim) and a reroll button (once an hour). if a user doesn't have enough currency to reroll it should tell him but he can still claim through the other buttons and here come the problem as the reroll button (should be always working not only for 10 minutes). for the 3 buttons i use a collector that works for 10 minutes only but for the reroll i use a the events. when a user reroll it-regenerate the buttons of claim but when trying to claim it run twice
7 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!Yes thats basically the problem, 🤷 but im not sure how to disable the first collector when the 10 minutes cooldown are not passed and a user click the reroll that runs through the events
well the thing is with this approach, that when you click the reroll command there is 2 possibilities:
- You have currency and you're not on cooldown so you can reroll and have new buttons to claim
- You don't have currency so it just tell you "you can't reroll". but you can still claim from the other 3 buttons that work with the collector
=> So of i disable and we are on possibility number 2, user can't claim from his original buttons
what do you suggest?