我的代码很好,一切都很好,但我在discord.js最后一个版本上遇到了一个错误
错误:
const bot = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.<anonymous> (C:\Users\SasYT\Documents\DiscordBOTS\GDPS\bot.py:3:60)
at Module._compile (node:internal/modules/cjs/loader:1233:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
字符串
我的代码:
const { Client, GatewayIntentBits } = require('discord.js')
const client = new Client({
intents: [ [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });
bot.once('ready', () => {
console.log('Bot is ready!');
});
型
1条答案
按热度按时间mtb9vblg1#
在discord.js v14中,需要使用
GatewayIntentBits
字符串