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

169
Visualizações
TypeError [COMMAND_INTERACTION_OPTION_EMPTY]: Required option "message" is of type: _MESSAGE; expected a non-empty value. (Discord.js)

Why does this code throw error?

client.on("interaction", interaction => {
  if (!interaction.isContextMenu()) return;
  const msg = interaction.getMessage("message", true);
});
TypeError [COMMAND_INTERACTION_OPTION_EMPTY]: Required option "message" is of type: _MESSAGE; expected a non-empty value.

I'm using discord.js v 13 and the djs server couldn't help me.

Please help? thank you

Btw I have no intents because this is going to be application.commands only bot, so I have intents of intents: []

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Even though other sources may outline that you don't need any intents for an interaction-only bot that has only the application.commands scope, discord.js requires the GUILDS or 1 scope.

Your new client constructor should be:

const client = new Client({
  intents: 1,
  // ... rest of the client constructor
});

Also, the interaction event is deprecated. Use interactionCreate instead, it's the exact same thing, just a different name.

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