我只是想先让这个机器人上线。它一直在抛位字段错误。我猜我需要添加权限,但不确定最好的方法是什么,我对此非常陌生。
需要(‘dotenv’).config(); const { Client,Intents,BitField} =需要量(‘discord.js’);const client=新客户端({ intents: Intents.FLAGS.GUILDS});
错误:
RangeError BITFIELD_INVALID:无效的位字段标志或数字:未定义。在(C:\Users\tayla\documents\discord-bot\node_modules\discord.js\src\util\BitField.js:152:11) Function.resolve
C:\Users\tayla\documents\discord-bot\node_modules\discord.js\src\util\BitField.js:147:54 at Array.map () at Function.resolve (C:\Users\tayla\documents\discord-bot\node_modules\discord.js\src\util\BitField.js:147:40)
在(C:\Users\tayla\documents\discord-bot\node_modules\discord.js\src\client\Client.js:550:33)的新客户端,(C:\Users\tayla\documents\discord-bot\node_modules\discord.js\src\client\Client.js:76:10)在Client._validateOptions,对象。(C:\Users\tayla\documents\discord-bot\src\bot.js:4:15) at Module._compile (节点:内部/模块/cjs/加载器:1101:14)在Object.Module._extensions..js (节点:内部/模块/cjs/加载程序:1153:10),Module.load (节点:内部/模块/cjs/加载程序:981:32){符号(代码):'BITFIELD_INVALID‘}
发布于 2022-02-06 01:54:47
尝试将Intents.FLAGS.GUILDS放入数组中,如文档中所示。intents: [Intents.FLAGS.GUILDS]
https://stackoverflow.com/questions/70872313
复制相似问题