【发布时间】:2021-05-23 08:49:34
【问题描述】:
我有一个不和谐的机器人,在我的场所(Windows 10)它可以正常工作,但在服务器(Ubuntu Server 20)上它给了我以下错误。
当我收到来自服务器的聊天消息时发生错误,例如,在我的计算机上,我会阅读该消息并回复它,在服务器上,我收到错误。
(node:657201) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).flatMap is not a function
at Promise.all.events.map (/root/discordbot/node_modules/@typeit/src/logic/metadatas/MetadataStorage.ts:155:14)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:657201) 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(). (rejection id: 1)
(node:657201) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`
都是同一个项目,一切都一样,我不知道会发生什么。
【问题讨论】:
-
您是否尝试使用 discord.js 发送嵌入式按摩?
-
Ubuntu机器上的Node版本是多少?基于this,你需要Node >= 11
-
显示你的代码和
node -v -
@Owl 我有 v10.19.0
-
@Garto 是的,但我认为崩溃正在尝试读取消息
标签: javascript node.js typescript discord.js