所以我正在嘗試制作一個不和諧的機器人,但我遇到了一個問題
ReferenceError: Client is not defined
at Object.<anonymous> (C:\Users\Arya\Desktop\Arya\Discord\bot.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
代碼是
require("dotenv").config();
const { Cient, Intents } = require("discord.js");
const client = new Client({
intent: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES
]
});
bot.login(process.env.TOKEN);
請幫我
uj5u.com熱心網友回復:
簡單的語法錯誤,很高興幫助這應該作業
require("dotenv").config();
const { Cient, Intents } = require("discord.js");
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES
]
});
client.login(process.env.TOKEN);
您在底部的登錄使我混淆了 bot 變數的位置,但如果我的代碼不起作用,您可以將其更改回來。否則,您只需要添加意圖。快樂編碼:)
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/376141.html
標籤:javascript 节点.js json 不和谐 不和谐.js
上一篇:[移動端]移動端設備屬性
