Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

505
Vistas
(DISCORD.JS) ¿Cómo soluciono mi comando discord "cmds"?

Me preguntaba cómo soluciono mi comando "cmds". Parece que no puedo hacer que funcione correctamente. Se supone que debe obtener todos los comandos y agregar un campo con el nombre y la descripción de los comandos a una inserción, pero en su lugar aparece con este error , también el árbol de archivos está aquí .

 module.exports = { name:'cmds', description:'Literally shows the commands thats it.', aliases:'', execute(client,msg,args,blacklisted){ const fs = require('fs') const {MessageEmbed} = require("discord.js") const embed = new MessageEmbed() function getCommand(cmd){ return client.commands.get(`${cmd}`) } const commandFiles = fs.readdirSync('.').filter(file => file.endsWith('.js')); for (const file of commandFiles){ const command = require(`./${file}`) embed.addField(command.name,```${command.description}```) } const author = msg.author const user = msg.mentions.members.first() || msg.author; const useronly = msg.mentions.users.first() if (blacklisted.includes(author.id)){ msg.reply(`You have been blacklisted from using this bot. if you think this is a mistake contact the bot owner.`) }else{ embed.setTitle(`Commands`) embed.setColor('RANDOM') msg.reply({embeds : [embed] }) } } }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

lo resolví haciendo esto

 function getCommand(cmd){ return client.commands.get(`${cmd}`) } console.log(getCommand('avatar').name) const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); for (const file of commandFiles){ const command = require(`./${file}`) embed.addField(`${command.name}`,`\`\`\ ${command.description} \`\`\ `) }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda