Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript discord.js管理器已被销毁_Javascript_Discord_Discord.js - Fatal编程技术网

Javascript discord.js管理器已被销毁

Javascript discord.js管理器已被销毁,javascript,discord,discord.js,Javascript,Discord,Discord.js,我正试图启动我的discord机器人,但我一直遇到这个错误,我不知道如何修复它,没有任何在线指向我的任何方向。任何帮助都将不胜感激 const commando = require('discord.js-commando'); const path = require('path'); const oneLine = require('common-tags').oneLine; const client = new commando.Client({ owner: '1841914

我正试图启动我的discord机器人,但我一直遇到这个错误,我不知道如何修复它,没有任何在线指向我的任何方向。任何帮助都将不胜感激

const commando = require('discord.js-commando');
const path = require('path');
const oneLine = require('common-tags').oneLine;

const client = new commando.Client({
    owner: '184191493919997952',
    commandPrefix: '>',
    invite: 'https://discord.gg/YB8fmw#'
});

client.login('token num').token;


Registered group basic.
Registered argument type string.
Registered argument type integer.
Registered argument type float.
Registered argument type boolean.
Registered argument type user.
Registered argument type member.
Registered argument type role.
Registered argument type channel.
Registered argument type message.
Registered argument type command.
Registered argument type group.
Registered group commands.
Registered group util.
Registered command util:help.
Registered command util:prefix.
Registered command util:ping.
Registered command util:eval.
Registered command commands:groups.
Registered argument type group|command.
Registered command commands:enable.
Registered command commands:disable.
Registered command commands:reload.
Registered command commands:load.
Registered command commands:unload.
Registered argument type dank.
Registered command basic:roll.
Preparing to connect to the gateway...
[WS => Manager] Manager was destroyed. Called by:
Error: MANAGER_DESTROYED
    at WebSocketManager.destroy (C:\Users\user\Desktop\HogwartsBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:335:54)
    at CommandoClient.destroy (C:\Users\user\Desktop\HogwartsBot\node_modules\discord.js\src\client\Client.js:235:13)
    at CommandoClient.destroy (C:\Users\user\Desktop\HogwartsBot\node_modules\discord.js-commando\src\client.js:174:15)
    at CommandoClient.login (C:\Users\user\Desktop\HogwartsBot\node_modules\discord.js\src\client\Client.js:224:12)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:21856) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
    at WebSocketManager.connect (C:\Users\user\Desktop\HogwartsBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:135:26)
    at CommandoClient.login (C:\Users\user\Desktop\HogwartsBot\node_modules\discord.js\src\client\Client.js:221:21)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21856) 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:21856) [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.
上面的代码错误如下。
似乎找不到修复方法,所以我猜我弄坏了一些东西:P但是visual studio没有报告列为原因的文件中的问题。

修复了多次令牌重新生成后,它最终接受了一个令牌,我要感谢Rup的帮助。

你能发布与此错误相关的代码吗?看起来像是你的客户端登录()调用失败:打印“准备连接到网关”,并在失败时销毁web套接字管理器。在那之后你真的不会再有错误了吗?它应该给你登录失败的详细信息。抱歉,伙计们认为它粘贴了OK OK你需要解决的问题是:“错误[TOKEN\u INVALID]:提供了无效的TOKEN。”你从哪里获得TOKEN?你能试着生成一个新的吗?我试过了,它也不喜欢