help with invite tracker needed
hey, i'm not that experienced with coding discord bots and i need help with an invite tracker. right now i have a /invites command that tells the user how many invites they have. it works fine but i want the invites to only track members that are in the server. so if a member that they have invited leaves the server, their invites go down. i'm not even show how i'd go about creating that, just looking for some direction on how i'd do something like this. here's how invites are currently tracked:
4 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!
- ✅
Marked as resolved by OPalso please tag me in your response
you'd need some means of tracking which invite a given member used
discord doesn't provide this info, so you'd basically need to fetch invites everytime
guildMemberAdd
emits and compare the uses
from before and after
then you can listen to the guildMemberRemove
event to count how many would need to be subtracted from the sum of uses as you have hereok thanks for the help