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

543
Views
How do I get the guild.id from the server when the bot joins discord.js v13

as the caption says I don't know how I get the guild.id from a server when the bot just joined. I need the guild.id inside the guildCreate event.

EDIT: My problem was a misspell in my code that didn't got tagged as an error. Because I need the guild.id for a database entry I'm using MySQL and I was missing a "`". Thanks for all the help.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Just take the guild as a parameter to guildCreate:

client.on('guildCreate', (guild) => {
  const { id } = guild;
  // do something with id
});
about 4 years ago · Santiago Trujillo 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!