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

292
Views
Discord.js .cleanContent property lost on Object.keys(), and not loggable

I have a Discord.js Message instance, which, as defined in the documentation, should have a .cleanContent property, and it should be a string.

  • console.log(message.cleanContent) works as intended, but
    console.log(message) does not log the cleanContent property.
  • More so, Object.keys(message) does not discover the cleanContent property.
  • However, JSON.parse(JSON.stringify(message)) has a loggable, visible cleanContent in turn.
  • A for(key in message) loop also does not list the .cleanContent.

So, uh.. what is going on here?

The bug is reproducable with this much code:

client.on("messageCreate", (message) => {
  console.log(Object.keys(message))
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is due to the fact that it's a getter, as shown here. Getters don't seem to be logged in node.js, unlike in my browser's developer console (Chrome). Getters are different in different environments, so it's difficult to provide a solution.

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!