【发布时间】:2021-10-19 03:32:09
【问题描述】:
所以我正在使用 discord.js,但在记事本中工作时犯了错误,现在我在运行以下命令时遇到内部错误:
client.on('message', async (message) => {
if (message.content == "help") {
message.channel.send({embed: {
color: 0,
title: "Commands:",
fields: [
{ name: "Commands", value: "help /support: \n help /games: \n help /commands:", inline: true},
{ name: "Actions", value: "Need help? Don't worry! \n Play a fun game or two. \n Need help with the basics? No problem.", inline: true}]}
});
我做错了什么?
错误是:
index.js:64
});
SyntaxError: Unexpected end of input
←[90m at Object.compileFunction (node:vm:352:18)←[39m
←[90m at wrapSafe (node:internal/modules/cjs/loader:1025:15)←[39m
←[90m at Module._compile (node:internal/modules/cjs/loader:1059:27)←[39m
←[90m at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)←[39m
←[90m at Module.load (node:internal/modules/cjs/loader:975:32)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:816:12)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m
谢谢!
【问题讨论】:
-
看起来你对右括号/大括号感到困惑......似乎你错过了关闭 if 循环体?!使用更简洁的方式缩进代码以避免此类错误
标签: javascript node.js discord discord.js