El título puede ser un poco confuso, así que aquí hay una captura de pantalla de lo que sucede cuando escribo un comando:
Funciona, pero luego falla al mismo tiempo. No recibo errores de esta interacción. Aquí está mi código:
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(`👎`)); }); }, };Prueba a aplazar la respuesta. Más info al respecto aquí
Por ejemplo,
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!'); } });