discord.js管理器被破坏

时间:2020-05-10 15:43:56

标签: 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: '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并没有报告列为原因的文件中的问题。

1 个答案:

答案 0 :(得分:1)

修复了许多令牌后,终于接受了令牌,我要感谢Rup的帮助。