Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!