admin 管理员组文章数量: 1086019
I've just started working on a discord bot, but whenever I try to start it using node . in the cmd prompt, I get this error;
ReferenceError: Client is not defined
at Object.<anonymous> (C:\Users\imkav\Desktop\DiscordBot\index.js:2:16)
at Module._pile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
I've looked around and cant find anything specific enough to fix my issue. Here is my code;
const Discord = require("discord.js");
const Client = new Client();
Client.login("TheToken");
As I said I just started today, so There isn't much here
I've just started working on a discord bot, but whenever I try to start it using node . in the cmd prompt, I get this error;
ReferenceError: Client is not defined
at Object.<anonymous> (C:\Users\imkav\Desktop\DiscordBot\index.js:2:16)
at Module._pile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
I've looked around and cant find anything specific enough to fix my issue. Here is my code;
const Discord = require("discord.js");
const Client = new Client();
Client.login("TheToken");
As I said I just started today, so There isn't much here
Share Improve this question asked Aug 23, 2018 at 18:39 KaveenKaveen 31 gold badge1 silver badge2 bronze badges1 Answer
Reset to default 2I think the Discord documentation says you should use Discord.Client();
const Discord = require('discord.js');
const client = new Discord.Client();
本文标签: javascriptReferenceError Client is not defined Discord JS errorStack Overflow
版权声明:本文标题:javascript - ReferenceError: Client is not defined Discord JS error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744039080a2522918.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论