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

254
Views
DiscordAPIError: Invalid Form Body user_id: Value is not a snowflake

I am trying to get my leaderboard script to work, but I keep encountering this error.

This only started after I started using a command handler:

module.exports = {
    name: "leaderboard",
    aliases: ['lb'],
    description: "leaderboard",
    async run (Discord, client, message, member, args, Levels) {
      const rawLeaderboard = await Levels.fetchLeaderboard(message.guild.id, 10);
      if (rawLeaderboard.length < 1) return message.reply("Nobody's in leaderboard yet.");
      const leaderboard = await Levels.computeLeaderboard(client, rawLeaderboard, true);
      const lb = leaderboard.map(e => `${e.position}. 
             ${e.username}#${e.discriminator}\nLevel: 
             ${e.level}\nXP: ${e.xp.toLocaleString()}`);
      const embed = new Discord.MessageEmbed()
       .setColor("WHITE")
       .setTitle("LEADERBOARD")
       .setDescription(lb.join("\n\n"))
      message.channel.send({embeds: [embed]});
   }
}

ERROR:

\node_modules\discord.js\src\rest\RequestHandler.js:350 throw new DiscordAPIError(data, res.status, request); ^

DiscordAPIError: Invalid Form Body user_id: Value "<@My ID>" is not snowflake. at RequestHandler.execute (C:\Users\ME\OneDrive\Desktop\Discord Bots\Test Bot\node_modules\discord.js\src\rest\RequestHandler.js:350:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:\Users\ME\OneDrive\Desktop\Discord Bots\Test Bot\node_modules\discord.js\src\rest\RequestHandler.js:51:14) at async UserManager.fetch (C:\Users\ME\OneDrive\Desktop\Discord Bots\Test Bot\node_modules\discord.js\src\managers\UserManager.js:93:18) at async Function.computeLeaderboard (C:\Users\ME\OneDrive\Desktop\Discord Bots\Test Bot\node_modules\discord-xp\index.js:271:22) at async Object.run (C:\Users\Me\OneDrive\Desktop\Discord Bots\Test Bot\commands\leaderboard.js:15:29) { method: 'get',
path: '/users/<@my id>', code: 50035, httpStatus: 400, requestData: { json: undefined, files: [] } }

about 4 years ago · Santiago Gelvez
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!