【问题标题】:How to send Embed in Discord using bot coded in js?如何使用 js 编码的机器人在 Discord 中发送嵌入?
【发布时间】:2020-06-29 00:28:03
【问题描述】:

我正在编写一个 Discord 机器人来宣布 ETS2 的车队,但该机器人无法识别命令 const embed = new Discord.RichEmbed()。当我在 Discord 中使用命令激活机器人 (;convoy sim1) 时,我收到一条错误消息 TypeError: Discord.RichEmbed is not a constructor。我已尽力调试代码,但未能解决问题。我遵循了所有关于使用机器人发送嵌入的教程,但没有任何帮助。

【问题讨论】:

    标签: javascript node.js embed discord discord.js


    【解决方案1】:

    如果您使用的是 discord.js 版本 12 或更高版本,则需要使用 Discord.MessageEmbed 而不是 Discord.RichEmbed。来自documentation

    警告

    在master分支上,接收和传出的embed类已经统一了;您将需要使用 Discord.MessageEmbed() 作为构造函数。

    【讨论】:

      猜你喜欢
      • 2021-05-30
      • 2017-12-05
      • 2021-04-10
      • 2021-01-12
      • 2020-09-14
      • 2021-07-20
      • 2021-07-24
      • 1970-01-01
      • 2021-11-16
      相关资源
      最近更新 更多