为了账号安全,请及时绑定邮箱和手机立即绑定

不和谐.js令牌登录问题

不和谐.js令牌登录问题

翻阅古今 2022-08-18 10:01:15
我的机器人不会联机,即使我重新生成令牌也是如此。我试图放一个捕获块,但没有任何变化。问题是我的电脑吗 ? 脚本 ?还是我的节点版本(最后一个 LTS 版本)?我希望你有时间回答我!这是错误:    (node:1976) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.    at WebSocketConnection.<anonymous> (C:\Users\Atelier34bc\Documents\mpbot\node_modules\discord.js\src\client\ClientManager.js:48:41)    at Object.onceWrapper (events.js:417:26)    at WebSocketConnection.emit (events.js:310:20)    at WebSocketConnection.onClose (C:\Users\Atelier34bc\Documents\mpbot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:390:10)    at WebSocket.onClose (C:\Users\Atelier34bc\Documents\mpbot\node_modules\ws\lib\event-target.js:124:16)    at WebSocket.emit (events.js:310:20)    at WebSocket.emitClose (C:\Users\Atelier34bc\Documents\mpbot\node_modules\ws\lib\websocket.js:191:10)    at TLSSocket.socketOnClose (C:\Users\Atelier34bc\Documents\mpbot\node_modules\ws\lib\websocket.js:850:15)    at TLSSocket.emit (events.js:322:22)    at net.js:672:12(node:1976) 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:1976) [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.这是我的脚本:const bot = new Discord.Client()const PREFIX = "$"const token = 'my_token'bot.on('ready', () => {    console.log('bot is online')})
查看完整描述

1 回答

?
眼眸繁星

TA贡献1873条经验 获得超9个赞

我尝试了我自己的机器人代码,它工作正常,你有没有检查你使用的是机器人令牌而不是客户端ID?


查看完整回答
反对 回复 2022-08-18
  • 1 回答
  • 0 关注
  • 109 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号