- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我开始学习 discord.js,但现在我面临这个问题。
我尝试了一些谷歌搜索,但无法修复它。
const Discord = require('discord.js');
// const Discord = require('discord.js');
// using Intents class
const client = new Discord.Client();
client.on('message', (msg) => {
// Send back a reply when the specific command has been written by a user.
if (msg.content === '!hello') {
msg.reply('Hello World!');
}
});
client.login('my_token');
这是我得到的错误:
最佳答案
您需要使用 gateway intents 指定希望机器人接收的事件.
代替const client = new Discord.Client();
利用const client = new Discord.Client({ intents: [Enter intents here] })
例如const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
这是另一个有用的链接:https://discord.com/developers/docs/topics/gateway
关于javascript - 如何修复 CLIENT_MISSING_INTENTS 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68694195/
我开始学习 discord.js,但现在我面临这个问题。 我尝试了一些谷歌搜索,但无法修复它。 const Discord = require('discord.js'); // const Disc
这个问题在这里已经有了答案: How do I fix CLIENT_MISSING_INTENTS error? (5 个答案) 关闭 1 年前。 这是我的代码: import { Cli
这个问题在这里已经有了答案: How do I fix CLIENT_MISSING_INTENTS error? (5 个答案) 关闭 1 年前。 这是我的代码: import { Cli
我是一名优秀的程序员,十分优秀!