【问题标题】:RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be emptyRangeError [EMBED_FIELD_VALUE]:MessageEmbed 字段值可能不为空
【发布时间】:2021-10-09 04:56:27
【问题描述】:

我有这个代码,但我不断收到这个错误:

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.

    at Object.run (C:\Users\Sochum\Desktop\BobloxBot\commands\GroupStats.js:41:2)

Line 41 has this code: .addFields(     

代码如下:

const embed = new Discord.MessageEmbed() 
.setTitle(`${groupname}`)
.addFields(     
    { name: `???? Group Owner`, value:  `<@${owner}>` },

    { name: `???? Group Co-Owner`, value:  `<@${co_owner}>` },
    { name: `???? Member Count`, value:  `${membercount}` },
    { name: `???? Group Funds`, value:  `${funds}` },
    { name: `???? Group Items`, value:  `${group_items}` },
    { name: `????Group Birthday`, value:  `${Group_Bday}` },
    { name: `????Group Sharing Circle`, value:  `${sharing_circle}` },
    { name: `????Group Warwins`, value:  `${Group_Warwins}` },
    { name: `????Group Warlosses`, value:  `${Group_Warlosses}` },
  )   
  message.channel.send(embed)

我似乎在任何地方都找不到问题,所以我不确定为什么会收到此错误

【问题讨论】:

    标签: javascript discord.js


    【解决方案1】:

    我已经运行了您的代码,它对我来说运行良好。当其中一个字段值为空时会发生此错误,因此请确保定义了所有变量并且可以在字符串中读取它们。

    【讨论】:

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