【问题标题】:Declaration or statement expected.ts(1128) on my discord bot on .setColor.setColor 上我的不和谐机器人上的声明或声明 expected.ts(1128)
【发布时间】:2021-05-21 09:36:15
【问题描述】:

我正在编写一个嵌入到我的不和谐机器人中的代码,然后当我尝试运行它时,代码给了我一个错误:

Declaration or statement expected.ts(1128) C:\Users\jerem\OneDrive\Desktop\AriaBot\index.js:23
                .setColor('#53BBFF')
                ^

SyntaxError: Unexpected token '.'
    at wrapSafe (node:internal/modules/cjs/loader:1018:16)
    at Module._compile (node:internal/modules/cjs/loader:1066:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
    at Module.load (node:internal/modules/cjs/loader:967:32)
    at Function.Module._load (node:internal/modules/cjs/loader:807:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47`

我不知道出了什么问题,这是我的完整代码,谁能帮帮我?

【问题讨论】:

  • 请不要发布代码截图,而是代码本身。

标签: javascript node.js discord discord.js


【解决方案1】:

在调用RichEmbed 构造函数后,你有一个;,基本上结束了它。

您现在输入的内容如下所示

const roleEmbed = new Discord.RichEmbed();.setColor(...)

去掉分号。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-02
    • 1970-01-01
    • 2019-12-17
    • 2019-01-19
    • 2020-03-24
    • 2014-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多