Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
discord.js track invites for larger list

I found an answer on how to track invites here: How to make a invites command (Discord.js)

    client.on('message', message => {
        if(message.content === "-invite"){
            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.`); 
                }
            )
        }
    });

But what worries me is that this solution could be used for a discord server with 50k members and could check invites every 1-5 seconds. Will the bot still work or will the list be too large or the requests too many? If the list is too large, is there any better method?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!