【问题标题】:Discord Missing Intent Error on discord.jsdiscord.js上的Discord缺少意图错误
【发布时间】:2021-10-27 16:53:55
【问题描述】:

我在过去 6 小时内无法启动我的代码,昨天它运行良好,但它似乎不再运行我一直有一个错误说 ('CLIENT_MISSING_INTENT')

这是我的起始代码,我不明白我做错了什么

    const Discord = require('discord.js'),
    welcome = require('./welcome'),
    mute = require('./mute'),
    unmute = require('./unmute'),
    mongoose = require('mongoose'),
    Levels = require("discord-xp")


    

    const { Client, Intents } = require("discord.js");
const client = new Client({
  intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});

【问题讨论】:

标签: discord.js


【解决方案1】:

您确实错过了Intent。根据您的代码,您可能已经知道,discord.js 的 v13 要求您添加某些 Intent 以避免处理能力被丢给未使用的功能。

您可以查看所有可用的 Intent here,并尝试添加其中一些,看看您需要哪一个。根据您的代码,我看不出您缺少哪一个。

【讨论】:

    猜你喜欢
    • 2021-03-26
    • 2020-08-16
    • 2021-11-18
    • 1970-01-01
    • 2020-08-30
    • 2022-01-01
    • 2021-11-16
    • 1970-01-01
    • 2020-11-02
    相关资源
    最近更新 更多