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

143
Views
La colección no es una función Discord.js

Traté de hacer que mi bot buscara otros archivos de Javascript, pero dice que Collection is not a function

 client.command = Client.Collection(); const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js')); for(const file of commandFiles){ const command = require(`./commands/${file}`); client.commands.set(command.name, command); } } else if (command === 'ping'){ client.command.get('ping').execute(message,args); }

El código es más grande pero lo eliminé para que no ocupe tanto espacio.

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

0

Collection es una clase que debe invocarse una vez que se requiera de la biblioteca

 const { Collection } = require('discord.js'); client.commands = new Collection();
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!