【问题标题】:Cannot read properties of undefined (reading 'GUILD') on Node.js v18.12.1Cannot read properties of undefined (reading \'GUILD\') on Node.js v18.12.1
【发布时间】:2022-12-02 01:42:42
【问题描述】:

Here's my code:

require('dotenv').config();

const {REST} = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { Client, Intents, Collection } = require('discord.js');
const { Player } = require("discord-player");

const fs = require('fs');
const path = require('path');

const client = new Client [{
  intents: [
    Intents.GUILD,
    Intents.GUILD_MESSAGES,
    Intents.GUILD_VOICE_STATES
  ]
}];

I've been working this for an hour now but I still cant fix it

【问题讨论】:

  • What's your discord.js version?

标签: discord.js


【解决方案1】:

If you are using Discod.js V14 you need to change your Intents: https://discordjs.guide/popular-topics/intents.html#privileged-intents

【讨论】:

    猜你喜欢
    • 2021-11-10
    • 2021-11-03
    • 2021-11-08
    • 2021-12-31
    • 1970-01-01
    • 1970-01-01
    • 2022-07-09
    • 2022-01-11
    • 2021-12-11
    相关资源
    最近更新 更多