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

140
Views
TypeError: message.client.commands.array no es una función

Quería actualizar mi comando de ayuda de djs v12.5.3 a v13 pero recibí este error: TypeError: message.client.commands.array is not a function

Aquí está mi código que usé antes:

 let commands = message.client.commands.array(); commands.forEach((cmd) => { if(cmd.name == args[0].toLowerCase() || cmd.aliases.includes(args[0].toLowerCase())) { embed.addField("**Description**", `${cmd.description}`, false) embed.addField("**Usage**", `${cmd.usage}`, true) embed.addField("**Aliases**", `${cmd.alias}`, true) embed.addField("**Examples**", `${cmd.examples}`, true) message.channel.send({ embeds: [embed] }); } })

Intenté cambiar let commands = message.client.commands.array(); let commands = message.client.commands.values(); pero obtuve otro error: TypeError: commands.forEach is not a function . ¿Cómo puedo volver a enumerar mis comandos en v13?

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

0

Esa función fue eliminada . En lugar de .array , debe hacer lo siguiente:

 let commands = [...message.client.commands.values()]

Sin embargo, no hay razón para convertir, a menos que desee mostrar todos los valores fácilmente.

message.client.commands.each funcionará bien

 message.client.commands.each((cmd) => {})
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!