![](/img/trans.png)
[英]Node.js Discord Bot : TypeError: Cannot read property 'send' of undefined
[英]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]
});
如果有人知道我能做什么,將不勝感激。
從 v14 開始, Intents
現在是GatewayIntentBits
https://discordjs.guide/additional-info/changes-in-v14.html#enum-values
https://discord-api-types.dev/api/discord-api-types-v10/enum/GatewayIntentBits
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.