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

59
Views
JS Discord Rankbot

I am working on a system which Auto Ranks you in our discord server when visited. The page would be private and visited by a different source code (in lua).

app.get('/', (req, res) => {
    let Member = req.param("Discord");

    async function abc() {
        let guild = await Client.guilds.cache.get("893848693248241744");
        let member = await guild.members.cache.get(Member);
        var role = await guild.roles.cache.get("893848693248241747");

        console.log(member.ToString())
        member.roles.add(role).catch(console.error);
    }
    abc()
        
    res.json({"status": "true", "userid": req.param("Discord")})
});

The variable "member" gets returned nil. What do I do? Discord.js v12

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I needed to use .fetch instead of .get to fetch the uncached data

let guild = await Client.guilds.fetch("893848693248241744");
let member = await guild.members.fetch(Member);
var role = await guild.roles.fetch("893848693248241747");

member.roles.add(role).catch(console.error);
about 4 years ago · Juan Pablo Isaza Report
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!