【发布时间】:2021-08-16 05:43:16
【问题描述】:
我想使用 replit 来制作我的 discord 机器人。我在 node.js repli 上安装了 discord.js。我在 index.js 中插入了这段代码:
const { Client, Intents } = require("discord.js");
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});
client.on("ready", () => {
console.log("If you can see this in the console when you run it on replit, I will be shocked lol")
});
client.login(process.env["BOT_TOKEN"]);
不知何故,它输出了一个错误。它指出: 常量令牌 = this.client.token ?? this.client.accessToken 语法错误:意外标记:'?'
谢谢你, 保罗10
【问题讨论】:
标签: discord.js