Me gustaría hacer que esto envíe una inserción en lugar de que diga "Si desea aplicar, haga clic en el botón de abajo", y tenga el botón Aplicar debajo de la inserción. parece que nada funciona con eso Si alguien pudiera ayudarme, se lo agradecería 🙂
Dos personas muy serviciales me han ayudado.
@Skulaurun Mrusal y @PerplexingParadox
¡Gracias! 🙂
client.on("message", async (message) => { // Don't reply to bots if (message.author.bot) return; if (message.content == "#req") { if(!message.member.hasPermission("MANAGE_MESSAGES")) { message.reply("You do not have permission to do that!"); return; } // Perform raw API request and send a message with a button, // since it isn't supported natively in discord.js v12 client.api.channels(message.channel.id).messages.post({ data: { embeds: [reqEmbed], components: [ { type: 1, components: [ { type: 2, style: 4, label: "Apply", // Our button id, we can use that later to identify, // that the user has clicked this specific button custom_id: "send_application" } ] } ] } }); } });Solo necesita modificar su código con una línea. Solo tiene que enviar su exampleEmbed a través de la publicación de Discord API en lugar de usar el método discord.js .
Para hacer eso, todo lo que tiene que hacer es agregar un campo de inserción, que exampleEmbed embed embeds colocarlo allí.
Como esto:
client.api.channels(message.channel.id).messages.post({ data: { //adds the embed here, so the button and embed will be sent together embeds: [exampleEmbed], components: [ { type: 1, components: [ { type: 2, style: 1, label: "Apply", // Our button id, we can use that later to identify, // that the user has clicked this specific button custom_id: "send_application" } ] } ], } });Aquí está la documentación de la API de Discord como referencia.
Además, parece que discord.js v13 también admite botones, pero como se lanzó recientemente, no he tenido tiempo de comprobarlo.