簡體   English   中英

discord bot Node.js TypeError 的問題:無法讀取未定義的屬性(讀取“FLAGS”)

[英]Problem with discord bot Node.js TypeError: Cannot read properties of undefined (reading 'FLAGS')

嗨,我對編碼一無所知,但我試圖通過教程制作一個 discord 機器人,但在 vs code 上我收到此錯誤:

TypeError:無法讀取未定義的屬性(讀取“FLAGS”)

這是代碼的前 14 行

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.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_VOICE_STATES]
});

如果有人知道我能做什么,將不勝感激。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM