i an getting an error in my discord bot, please tell how fix

I am coding a discord bot with the help of Cody Lyons video on the basics of discord bot making: video

The Error:

C:\Users\mdfar\bot\node_modules\discord.js\src\client\Client.js:544
      throw new TypeError('CLIENT_MISSING_INTENTS');
      ^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
    at Client._validateOptions (C:\Users\mdfar\bot\node_modules\discord.js\src\client\Client.js:544:13)
    at new Client (C:\Users\mdfar\bot\node_modules\discord.js\src\client\Client.js:73:10)
    at Object.<anonymous> (C:\Users\mdfar\bot\index.js:2:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  [Symbol(code)]: 'CLIENT_MISSING_INTENTS'

my Code:

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

const token = 'OTIwOTQ3OTM1MjQyNTAyMTU1.Ybrxmg.lcPJbRn-xqIvsVieOt7emiAjD4w';

bot.on('ready', () =>{
    console.log('This Bot Is Online');
})

bot.login(token);

Help PLease I'm using node js for this



from Recent Questions - Stack Overflow https://ift.tt/3J0cK4n
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)