【发布时间】:2021-03-10 11:50:11
【问题描述】:
好的,我知道我之前在这里,但现在我搞砸了一些东西,试图添加另一个东西。基本上,我在控制台中收到一个未定义的错误,因为我不确定如何在 Discord.JS 的代码中编写它
代码:
const id = message.id.members.first();
控制台错误:
(node:16412) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'first' of undefined
at Object.execute (C:\Users\Saman\Desktop\gban-bot\commands\test.js:12:39)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16412) 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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16412) [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