Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

857
Visualizações
TypeError: MessageActionRow is not a constructor

Im using discord V13 and im getting this error. (If you prefer you can look at the code in this link: https://sourceb.in/8w8wKS1Wmy)

Main file:

// main.js

const Discord = require('discord.js'); 

The command file:

// command 

const {
    MessageActionRow,
    MessageButton
} = require('discord.js');
module.exports = {
    name: 'commands',
    permissions: [],
    description: "this sends help!",
    aliases: ['cmd', 'cmdinfo', 'commandsinfo'],
    execute(client, message, cmd, args, Discord) {

            const utilbtn = new MessageActionRow()
                .addComponents(
                    new MessageButton()
                    .setCustomId('primary')
                    .setLabel('Primary')
                    .setStyle('PRIMAMRY'),
                    
                );

            const newEmbed = new Discord.MessageEmbed()
                .setTitle('**Commands**')

            message.channel.send({
                embed: [newEmbed],
                component: [utilbtn]
            });
        }
    }
}

The error message:

// the error 

const utilbtn = new MessageActionRow()
                ^           

TypeError: MessageActionRow is not a constructor
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I cannot imagine how this is not working, unless if you are using the wrong version, consider running:

npm i discord.js@13.1.0

I've tried running both:

const { MessageActionRow } = require('discord.js');
// undefined
new MessageActionRow()
// MessageActionRow { type: 'ACTION_ROW', components: [] }

The commented lines are the response when running node in console. Maybe try checking package.json, should have a line like the following:

"discord.js": "^13.1.0"
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda