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();