MessageEmbed 字段值必须是非空字符串。帮助命令
MessageEmbed field values must be non-empty strings. help command
我正在尝试为我的 discord 机器人创建帮助命令,当我键入 .help 时出现错误
/app/node_modules/discord.js/src/util/Util.js:416
if (typeof data !== 'string') throw new error(errorMessage);
^
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
at Function.verifyString (/app/node_modules/discord.js/src/util/Util.js:416:41)
at Function.normalizeField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:544:19)
at /app/node_modules/discord.js/src/structures/MessageEmbed.js:565:14
at Array.map (<anonymous>)
at Function.normalizeFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:564:8)
at MessageEmbed.addFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:328:42)
at MessageEmbed.addField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:319:17)
at Object.execute (/app/commands/informational/help.js:12:10)
at module.exports (/app/events/messageCreate.js:28:18)
at Client.emit (node:events:390:28) {
[Symbol(code)]: 'EMBED_FIELD_VALUE'
}
在嵌入中添加字段时,它至少需要三个值。第一个是您要添加的字段的标题,第二个是字段的值。第三个值是一个布尔值,它说明该字段是否是内联的。您只传递了字段的标题,还需要传递一些内容作为值,例如:.addField('title', 'description', true)
。您可以在 Embeds | Discord.js
中了解有关嵌入的更多信息
我正在尝试为我的 discord 机器人创建帮助命令,当我键入 .help 时出现错误
/app/node_modules/discord.js/src/util/Util.js:416
if (typeof data !== 'string') throw new error(errorMessage);
^
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
at Function.verifyString (/app/node_modules/discord.js/src/util/Util.js:416:41)
at Function.normalizeField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:544:19)
at /app/node_modules/discord.js/src/structures/MessageEmbed.js:565:14
at Array.map (<anonymous>)
at Function.normalizeFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:564:8)
at MessageEmbed.addFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:328:42)
at MessageEmbed.addField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:319:17)
at Object.execute (/app/commands/informational/help.js:12:10)
at module.exports (/app/events/messageCreate.js:28:18)
at Client.emit (node:events:390:28) {
[Symbol(code)]: 'EMBED_FIELD_VALUE'
}
在嵌入中添加字段时,它至少需要三个值。第一个是您要添加的字段的标题,第二个是字段的值。第三个值是一个布尔值,它说明该字段是否是内联的。您只传递了字段的标题,还需要传递一些内容作为值,例如:.addField('title', 'description', true)
。您可以在 Embeds | Discord.js