为什么我无法登录 Discord.js 客户端?

Why can't I log into the Discord.js client?

此代码无效,它从未将 Ready! 记录到控制台。它也没有注销任何错误,因此我相信它可能已正确登录但无法正常工作。有人有什么指点吗?

var Discord = require("discord.js");
var client = new Discord.Client();

client.login('myEmail', 'myPassword', output);

client.on('ready', () => {
  console.log("Ready!");
});

function output(error, token) {
        console.log("errorz!");
        if (error) {
            console.log("There was an error logging in: ${error}");
            return;
        } else {
            console.log("`Logged in. Token: ${token}`");
        }
}

为了确保我做对了,我把它放在一个名为 discord-fisher.js 的文件中,我 运行 它使用来自终端的 node discord-fisher.js

the documentation for Discord.js 对于 Client#login:

.login( token )

Logs the client in, establishing a websocket connection to Discord.

因此,当您使用 login 时,您无需提供电子邮件或密码详细信息,而是提供与您的帐户相关联的 API 令牌