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

126
Vistas
Discord.js Adding multiple buttons using raw API request

Not 100% sure if I'm doing this right but it looks like the second component (line 13)
does not get recognized or something

am I doing this wrong or did I miss something? I tried following the documentation here but couldn't figure it out,

I just think my brain is just broken haha

I would appreciate the help

This is for the buttons using Discord.js 12.5.3

client.api.channels(applicationChannelId).messages.post({
   data: {
    embeds: [application],
   components: [{
    type: 1,
//accept button
   components: [{
    type: 2,
    style: 3,
    label: "Accept",
    custom_id: "accept",
//deny button
   components: [{
    type: 2,
    style: 4,
    label: "Deny",
    custom_id: "deny"
      }]
    }]
  }]
}

enter image description here

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

0

data.components accepts an array of MessageComponents so instead of trying to add multiple values of components you can just add it to an array like so:

client.api.channels(applicationChannelId).messages.post({
   data: {
    embeds: [application],
   components: [{
    type: 2,
    style: 3,
    label: "Accept",
    custom_id: "accept"},
  {
    type: 2,
    style: 4,
    label: "Deny",
    custom_id: "deny"
      },
]})
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