UnhandledPromiseRejectionWarning,discord.js javascrpt

编程入门 行业动态 更新时间:2024-10-09 16:32:16

UnhandledPromiseRejectionWarning,<a href=https://www.elefans.com/category/jswz/34/1771167.html style=discord.js javascrpt"/>

UnhandledPromiseRejectionWarning,discord.js javascrpt

我目前正在制作一个记录先前消息的不和谐的机器人,然后将其删除/编辑后发送给我,我完成了所有代码,但现在我的终端都充满了错误,说]]

    at Function.normalizeField (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:425:23)
    at C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:445:14
    at Array.map (<anonymous>)
    at Function.normalizeFields (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:444:8)
    at MessageEmbed.addFields (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:259:42)
    at MessageEmbed.addField (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:250:17)
    at module.exports (C:\NewCrackHeadsBot\Events\messageUpdate.js:8:2)
    at Client.<anonymous> (C:\NewCrackHeadsBot\index.js:26:38)
    at Client.emit (events.js:315:20)
    at Object.module.exports [as MESSAGE_UPDATE] (C:\NewCrackHeadsBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_UPDATE.js:14:12)
(node:18992) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see .html#cli_unhandled_rejections_mode). (rejection id: 5)
(node:18992) UnhandledPromiseRejectionWarning: RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.
    at Function.normalizeField (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:425:23)
PS C:\NewCrackHeadsBot> node .
this bot is online
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.
    at Function.normalizeField (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:425:23)
    at C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:445:14
    at Array.map (<anonymous>)
    at Function.normalizeFields (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:444:8)
    at MessageEmbed.addFields (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:259:42) 
    at MessageEmbed.addField (C:\NewCrackHeadsBot\node_modules\discord.js\src\structures\MessageEmbed.js:250:17)  
    at module.exports (C:\NewCrackHeadsBot\Events\messageUpdate.js:8:2)
    at Client.<anonymous> (C:\NewCrackHeadsBot\index.js:26:38)
    at Client.emit (events.js:315:20)
    at Object.module.exports [as MESSAGE_UPDATE] (C:\NewCrackHeadsBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_UPDATE.js:14:12) {
  [Symbol(code)]: 'EMBED_FIELD_VALUE'
}

此错误淹没了我的终端,我不确定如何解决此问题

这是我认为错误来自的代码,但我是一个初学者,所以我不确定是否可以显示其他代码

bot.on('messageUpdate', async(oldMessage,newMessage) => {

    require('./Events/messageUpdate')(oldMessage,newMessage)

})
bot.on('messageDelete', async(message) =>{

    require('./Events/messageDelete')(message)

})

我目前正在制作一个记录先前消息的不和谐机器人,然后将它们删除/编辑后发送给我,我完成了所有代码,但是现在我的终端都装满了错误,提示...

回答如下:

不太确定,但我认为您需要等待,因为您已异步。

更多推荐

UnhandledPromiseRejectionWarning,discord.js javascrpt

本文发布于:2024-05-07 13:55:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1756559.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:discord   UnhandledPromiseRejectionWarning   javascrpt   js

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!