The thing is like this, I try to upgrade my original robot to V13 , So I decided to rewrite the bot.
I don’t know how to get all Intents at once I tried Intents.all but it didn't work this is my code
const { Client, Intents, MessageEmbed } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const cofing = require("./cofig.json");
client.on('ready', () => {
console.log("================");
console.log("|i am ready|");
console.log("================");
});
client.on('message', async message => {
if(message.content === 'test'){
console.log("test")
}
});
client.login(cofing.token);
If you could tell me how to write this, I would be very grateful
First of all:
There is a small error in your message event (client.on('message', ... )), it's no longer 'message', but 'messageCreate' in v13, so keep in mind u have to update that.
About the intents: If you would like to use all intents (which I don't recommend), you can define all the intents in one intent via a Bitfield, you do this with the following code:
const allIntents = new Intents(32767);
const client = new Client({ intents: allIntents });
FYI: First in the beginning of v13 there was a flag called ALL (Intents.FLAGS.ALL), but that was removed afterwards, so this is the alternative to it.