【发布时间】:2021-11-08 21:59:24
【问题描述】:
所以我想制作一个不和谐的机器人,当我输入 node 时。进入 CMD 它给了我一个错误。我的代码在下面
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
const client = new Discord.Client();
client.once('ready', () => {
console.log('Better Call Saul!');
});
client.login('The code');
错误:
抛出新的 TypeError('CLIENT_MISSING_INTENTS'); ^ TypeError [CLIENT_MISSING_INTENTS]:必须为客户端提供有效的意图。在 Client._validateOptions (C:\Users\Uzivatel\Desktop\joe\node_modules\←[4mdiscord.js←[24m\src\client\Client.js:544:13) 在新客户端 (C:\Users\Uzivatel\ Desktop\joe\node_modules\←[4mdiscord.js←[24m\src\client\Client.js:73:10) 在对象。 (C:\Users\Uzivatel\Desktop\joe\main.js:3:16) ←[90m at Module._compile (node:internal/modules/cjs/loader:1101:14)←[39m ←[90m at Object .Module._extensions..js
【问题讨论】:
标签: javascript node.js discord.js