[英]Client Missing Intents Error (Discord.js)
所以我一直在研究我制作了大約一年的 discord 機器人,盡管我在幾個月前停止了一段時間。 無論如何,我正在重新開始,昨晚我為我的機器人做了一個“-say (something)”命令。 它工作得很好,但今天,我再次檢查機器人,我開始收到一個錯誤,說明我沒有 state 有效意圖,但這是我的代碼(用於客戶端意圖)。
const Discord = require('discord.js');
const client = new Discord.Client({ partials: ["MESSAGE", "CHANNEL", "REACTION"]});
如果有人知道我做錯了什么,如果你能告訴我,我將非常感激。 謝謝!
const { Client, GatewayIntentBits , Partials } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
partials: [Partials.Message, Partials.Channel, Partials.Reaction]
)}
如果您使用的是 v14,則需要使用它
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.