My discord bot won't turn online - CLIENT_MISSING_INTENTS

Hi, so I was in the middle of scripting my bot, and I tried to turn it on but it won’t.

This is the code:

const Discord = require('discord.js')
const bot = new Discord.Client();

bot.on('ready', () => {
    console.log('Bot online')
})

bot.on('message', (message) => {
    if(message.author.bot) return;
    if(message.channel.type !== 'text') return;
    let prefix = '!';
    // here there ['hello', 'there']
    // !ban user reason []
    let MessageArray = message.content.split(' ');
    let cmd = MessageArray[0].slice(prefix.length)
    let args = MessageArray.slice(1)

    if(!message.content.startsWith(prefix)) return;

    if(cmd == 'hello') {
        message.channel.send('Hello');
    }
})

bot.login("my key")

And this is the error I’m getting:

I do have Node.JS installed.

Eeek, everybody is using js instead of python.

Next time :mag: search & also include the error inside of your title!

Discord Bot Error - Scripting Support / Alternate Language - Cookie Tech (thecookie.dev)

I’ve tried that and it still won’t turn on. I still get the same error.

What changes have you made?

I’ve turned all the intents on, but it is still doing nothing.

Read this please, that’s not what the solution was.

Also, please use slash commands, slash commands will be enforced soon.


Once again, I have a weak understanding of javascript so I’m not the best to help you on this.

Some of these stack overflows may also help:

javascript - Discord Api Valid intents must be provided for the Client - Stack Overflow
javascript - How do I fix CLIENT_MISSING_INTENTS error? - Stack Overflow

Check this please :smiley: @HayHay

1 Like

This topic was automatically closed after 7 days. New replies are no longer allowed.