Skip to content
Sign upLog in
← Back to Community
How to make a simple invite tracker
Profile icon
NoobieZr

I made this code running on discord.js to track your invites, if you need any help give me a DM on discord here: Tagged#4121.

Code:
client.on('message', message => {
if(message.content === "zr invites"){
var user = message.author;

message.guild.fetchInvites() .then (invites => { const userInvites = invites.array().filter(o => o.inviter.id === user.id); var userInviteCount = 0; for(var i=0; i < userInvites.length; i++) { var invite = userInvites[i]; userInviteCount += invite['uses']; } message.reply(`You have ${userInviteCount} invites.`); } ) }

});

Voters
Profile icon
GaspardWils1
Profile icon
NoobieZr
Comments
hotnewtop
Profile icon
NoobieZr

This code is broken now with the new d.js update, sorry