简体   繁体   中英

Discord.js Import Intents

I have been really frustrated about this new Discord.js update. It includes importing Intents, and I have no idea how to do that. Please can someone tell me a step by step guide?

I have tried enabling all Intents from the Discord Developer Portal, still doesn't work. I would be very grateful if someone could help me! :)

This is straight from the discord.js V13 Docs

eg

const { Client, Intents } = require('discord.js');
const myIntents = new Intents();
myIntents.add('GUILD_PRESENCES', 'GUILD_MEMBERS');

const client = new Client({ ws: { intents: myIntents } });

read more here

You can find this from the discordjs docs > https://discordjs.guide/popular-topics/intents.html#enabling-intents

const { Client, Intents, Message } = require('discord.js')
const client = new Client({
     intents: 32767,
});

32767 Means all intents. If you want to use the intents you want to use it is in the docs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM