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

307
Visualizações
I cant make my bot go online and it shows TypeError [CLIENT_MISSING_INTENTS] (vscode)
const Discord = require("discord.js");
const Bot = new Discord.Client({Intents:[Discord.Intents.FLAGS.GUILD_MEMBERS, Discord.Intents.FLAGS.GUILDS]})

Bot.on('ready', () => {
    console.log("The bot is online") 

    let commands = Bot.application.commands;

    commands.create({
        name: "hello" ,
        description: "reply hello to the user",
        options: [
            {
                name: "person",
                description: "The user you want to say hello to",
                require: true,
                type: Discord.Constants.ApplicationCommandOptionTypes.USER

            }
        ]
    })
 })
    

    Bot.on('interactionCreate', interaction => {
     if(!interaction.isCommand()) return;
     let name  = interaction.commandName
     let options = interaction.options;

     if(name == "hello") {
        interaction.reply({
            content: "Hello",
            ephemeral: false
        })
    }
    if(name == "sayhello"){
        let user = options.getUser('person');

        interaction.reply({
            content: 'Hello ${user.username}
        })
    }
})

bot.login("token")
about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Since discord.js v13, you need to provide Intents when declaring the client. They were introduced by Discord so that developers can choose what type of data the bot will need to receive. All you have to do is add intents when declaring the client. The code might look something like this:

const { Client } = require('discord.js')
const client = new Client({
    intents: [
        Discord.Intents.FLAGS.GUILDS,
        Discord.Intents.FLAGS.GUILD_MESSAGES
    ]
})

And also, as pointed by @Richie Bendall, you have capitalised the I when declaring the intents. You can learn more about intents in here => Gateway Intents | Discord.js

about 4 years ago · Juan Pablo Isaza Relatório

0

The intents is option is lowercase, not capitalised. See ClientOptions.

about 4 years ago · Juan Pablo Isaza Relatório

0

Well actually since the new discord.js update you need to provide the intents to the bot. This might help

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
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