我在虚拟机和AWS上设置了一个20.04Ubuntu服务器,以运行不再由开发人员托管的uno。(https://github.com/Exium1/UnoBot)我一直在遵循别人关于如何设置它的指南(https://github.com/DaanWet/UnoBot/blob/master/documentation/Install.md),但是当我启动它时,它失败了。
我得到以下错误:
(node:14998) UnhandledPromiseRejectionWarning: DiscordHTTPError: 401 Unauthorized on GET /api/v9/gateway/bot
at RequestHandler.request (/home/ubuntu/UnoBot/node_modules/eris-sharder/node_modules/eris/lib/rest/RequestHandler.js:75:15)
at Client.getBotGateway (/home/ubuntu/UnoBot/node_modules/eris-sharder/node_modules/eris/lib/Client.js:2135:36)
at ClusterManager.calculateShards (/home/ubuntu/UnoBot/node_modules/eris-sharder/src/sharding/clustermanager.js:507:38)
at process.nextTick (/home/ubuntu/UnoBot/node_modules/eris-sharder/src/sharding/clustermanager.js:179:41)
at process._tickCallback (internal/process/next_tick.js:61:11)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:14998) 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:14998) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js pro
cess with a non-zero exit code.有人能帮忙解决这个问题吗?
发布于 2021-12-16 14:58:36
为了解决已记录的UnhandledPromiseRejectionWarning警告,您可以通过在代码中添加以下内容来修复它:
process.on("unhandledRejection", console.error);这将更清楚地记录错误,并将防止您的控制台被这些警告填满。
至于@mmenschig所说的话,它们确实是正确的。确保将正确的令牌传递到<Client>.login()中。
https://stackoverflow.com/questions/70372020
复制相似问题