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

190
Views
How can I use a specific guild ID in discord.js?

I currently am working in a script that's automatically updated, and not called by any command or message. Thus, I have no message variable to call message.guild.id with. I am making a bot for one specific server, and I need my code to edit a specific channel within that server, thus needing the server ID. I tried

let server = client.guilds.get('<guild id>'), channel;

and using the server variable to find the specific channel I want it to edit. This however gives an error. Am I missing any dependencies, or is there an easier way to do this?

Thanks in advance!

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

0

client.guilds.get does not exist anymore. Use client.guilds.cache.get

let server = client.guilds.cache.get('<guild id>')
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!