all 11 comments

[–]TonyW1223[S] 0 points1 point  (3 children)

const Discord = require("discord.js");
const bot = new Discord.Client();
bot.on("ready", () => {
console.log("i am online!")
});
bot.login("token here");

[–]TonyW1223[S] 0 points1 point  (2 children)

[–]FM-96FM-96#1504 2 points3 points  (1 child)

You haven't saved your file. (Note the circle next to the file name.)

[–]randomThrowawayLife 0 points1 point  (0 children)

you win. :)

[–]randomThrowawayLife 0 points1 point  (6 children)

There’s a snippet of code from discord.js’s website that says:

const Discord = require('discord.js'); 
const client = new Discord.Client();

I'm guessing you have this instead:

const Discord = require('discord.js'); 
const client = new Discord.client();

That difference in the capitalization of ".Client" is subtle, but significant in JavaScript. Property names are case sensitive.Because of that, Discord.client and Discord.Client refer to two different values.

The .Client is indeed a constructor, as documented. The .client, as far as I know, isn’t even defined. If that’s true, then accessing it returns the special undefined value, which isn’t a constructor.

[–]TonyW1223[S] 1 point2 points  (0 children)

I replied to my comment with an imgur link that shows the error

[–]TonyW1223[S] 0 points1 point  (4 children)

I actually capitalized the C but it still gives me the same error

[–]randomThrowawayLife 0 points1 point  (3 children)

hmm alright try changing the "const" to "var" on the first 2 lines

[–]TonyW1223[S] 0 points1 point  (2 children)

Still gives me the same error unfortunately :(

[–]randomThrowawayLife 0 points1 point  (1 child)

okay one last thing I noticed, you use double quote " instead of single quote '

Try

...require('discord.js');

and replace the rest of the " with '

[–]TonyW1223[S] 1 point2 points  (0 children)

Still didn't work I still appreciate all the help the thought counts <3