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

254
Vistas
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 Respuestas
Responde la pregunta

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 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