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

253
Vistas
Command is working, but also getting 'interaction failed' at the same time?

Title might be a little confusing so here's a screenshot of what's happening when I type a command:

enter image description here

It works, but then it fails at the same time. I get no errors from this interaction. Here's my code:

const { SlashCommandBuilder } = require("@discordjs/builders");
const { MessageEmbed } = require("discord.js");

module.exports = {
  data: new SlashCommandBuilder()
    .setName("suggest")
    .setDescription("Send your suggestion to the specified channel")
    .addStringOption((option) =>
      option
        .setName("suggestion")
        .setDescription("Your suggestion")
        .setRequired(true)
    ),
  async execute(interaction) {
    let suggestion = interaction.options.getString("suggestion");
    const embed = new MessageEmbed()
      .setColor("#0099ff")
      .setTitle(`New suggestion by ${interaction.member.displayName}`)
      .setDescription(`${suggestion}`);
    await interaction.channel
      .send({
        embeds: [embed],
      })
      .then(function (interaction) {
        interaction.react(`👍`).then(interaction.react(`👎`));
      });
  },
};

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try deferring the reply. More info on it here

For example,

const wait = require('util').promisify(setTimeout);

client.on('interactionCreate', async interaction => {
    if (!interaction.isCommand()) return;

    if (interaction.commandName === 'ping') {
        await interaction.deferReply();
        await wait(4000);
        await interaction.editReply('Pong!');
    }
});
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