0

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._compile (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

1 Answer 1

2

I think the Discord documentation says you should use Discord.Client();

const Discord = require('discord.js');
const client = new Discord.Client();
Sign up to request clarification or add additional context in comments.

1 Comment

Dear lord I'm an idiot, of course I forgot something so simple, thank you for your help friend, sometimes I forget where I left my brain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.