我試過這個,這是我的另一個機器人的復制和粘貼
const client = new Discord.Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_PRESENCES,
],
})
錯誤:
ReferenceError: Intents is not defined
uj5u.com熱心網友回復:
簡單地說,您應該通過這樣做來定義意圖:
const { Client, Intents } = require('discord.js')
編輯:您不需要Discord在 discord.js v13 上使用,因為它不需要,而是這樣做:
const { Client, Intents } = require('discord.js')
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_PRESENCES,
],
})
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/478670.html
下一篇:javascript陣列分成塊
