未处理的PromiseRejection警告:Discordjs错误:请求使用令牌,但客户端无法使用令牌



嘿,我用discord xp制作了一个排行榜命令,但当我运行该命令时,它会出现以下错误:

(node:7400) UnhandledPromiseRejectionWarning: DiscordjsError: Request to use token, but token was unavailable to the client.
at RequestHandler.execute (C:UsersnielsDocumentsVsCode ProjectsDiscord Botsflat8node_modulesdiscord.jssrcrestRequestHandler.js:93:15)
at RequestHandler.execute (C:UsersnielsDocumentsVsCode ProjectsDiscord Botsflat8node_modulesdiscord.jssrcrestRequestHandler.js:97:19)
at RequestHandler.push (C:UsersnielsDocumentsVsCode ProjectsDiscord Botsflat8node_modulesdiscord.jssrcrestRequestHandler.js:39:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async UserManager.fetch (C:UsersnielsDocumentsVsCode ProjectsDiscord Botsflat8node_modulesdiscord.jssrcmanagersUserManager.js:67:18)        
at async Function.computeLeaderboard (C:UsersnielsDocumentsVsCode ProjectsDiscord Botsflat8node_modulesdiscord-xpindex.js:275:30)
at async callback (C:UsersnielsDocumentsVsCode ProjectsDiscord Botsflat8commandslevelingleaderboard.js:13:29)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7400) 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: 2)
(node:7400) [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.

我的代码

有人能帮我吗?


看起来您正在尝试执行操作,但您的客户端没有登录。也许您可以在此处找到帮助:
https://discordjs.guide/popular-topics/errors.html#request-使用令牌,但客户端无法使用令牌
希望我能提供帮助
ShadowLp174

[编辑]Sry,链接已断开-已修复;(

相关内容

  • 没有找到相关文章

最新更新