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

127
Views
La interacción del comando discord.js v13 slash falló

El comando no se ejecuta y aparece un error de "interacción fallida".

Por favor, dígame qué archivo está dando el error y cómo puedo hacerlo.

índice.js:

 client.commands = new 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.data.name, command); } client.once('ready', () => { console.log('봇이 준비됐습니다!'); }); client.on('interactionCreate', async interaction => { if (!interaction.isCommand()) return interaction.reply({content: '없는 명령어입니다...', ephemeral: true }); const command = client.commands.get(interaction.commandName); if (!command) return interaction.reply({ content: '명령을 실행하는 데 실패했습니다...', ephemeral: true }); try { await command.execute(interaction); } catch (error) { console.error(error); return interaction.reply({ content: '명령을 실행하는 데 실패했습니다...', ephemeral: true }); } }); s(); keepAlive(); client.login(token);

comandos/ayuda.js:

 async execute(interaction) { const helpembed = new MessageEmbed() .setColor('red') .setTitle('명령어') return interaction.reply({embeds: [helpembed]}); },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

hay varias cosas mal con su código

Archivo help.js :

  • ¿Ha importado el constructor MessageEmbed: const { MessageEmbed } = require('discord.js');
  • No puedes hacer .setColor('red') , tienes que hacer .setColor('#ff0000')

Archivo index.js :

  • const command = client.commands.get(interaction.commandName); ¿Por qué está tratando de obtener nuestras interacciones en los comandos? Tal vez debería intentar con const command = client.interactions.get(interaction.commandName); (si se declaró la colección de interacciones)

Para obtener más detalles sobre el error, tal vez verifique en su consola y proporcione el error si tiene acceso a él.

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!