Por lo tanto, estoy tratando de enviar una inserción y dos botones en un webhook desde el backend de mi sitio web, que se crea con express.js, a Discord con discord.js. Entonces, aquí está mi código fuente: -
const buttons = new MessageActionRow() buttons.addComponents( new MessageButton() .setLabel('View Purchase') .setStyle('LINK') .setURL(`...`), // url is present ) buttons.addComponents( new MessageButton() .setLabel('View Payment') .setStyle('LINK') .setURL(`...`), // url is present ) const embed = new MessageEmbed() // creating the embed await webhook.send({ embeds: [embed], components: [buttons] })He eliminado código innecesario. Entonces, si ejecuto esto, se envía la inserción, pero no los botones y no hay ningún error, excepto algunas advertencias que no están relacionadas.
(node:13492) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead. [0] (Use `node --trace-deprecation ...` to show where the warning was created)cambie .setFooter a este estilo: .setFooter({text: "your text", iconURL: "your link"