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

259
Views
discordjs buttons issue with Class extends value undefined is not a constructor or null

This is my command:

//comando button test
    if(prefix&&comando === 'button'){
        const embMessage = new discord.MessageEmbed()
        .setTitle('Teste de botões')
        .setDescription('Esse é um teste de botões')

        const yes = new MessageButton()
        .setStyle('green')
        .setLabel('Sim')
        .setID('smart')

        const no = new MessageButton()
        .setStyle('red')
        .setLabel('Não')
        .setID('dumbass')

        message.channel.send({embeds:[embMessage], buttons:[yes, no]})
    }

But I'm having this issue:

class sendAPICallback extends dAPIMessage {
                              ^

TypeError: Class extends value undefined is not a constructor or null

In that case, I can't run the bot code. :(

"discord-buttons": "^4.0.0"
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

To make them be sent "buttons" should be changed into "components"

message.channel.send({embeds:[embMessage], components:[yes, no]});

And as far as i know it should be an action row

message.channel.send({embeds:[embMessage], components:[new discord.MessageActionRow().components([yes, no])]});

And there you have it

Update: Just realized your using buttons package so idk if it will change a thing or not

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!