Discord bot problem,,

What am I doing wrong? I keep getting

"const client = new discord.client();
^

TypeError: discord.client is not a constructor
at Object. (C:\Users\Shiloh\Desktop\DiscordBot\main.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47"

My code is

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

const client = new Discord.Client();



client.once('ready', () => {
    console.log('Shadow Bot is online');
});



client.login('BOTTOKENHERE);

you’re programming in JavaScript, which treats capitalization as significant. you’ll have to consult the discord.js docs and pay attention to what should be lowercase, uppercase, all caps, etc.

in fact, there’s already something fishy going on with the error message not matching up with the error message not matching up with code you posted:

from your error message:

const client = new discord.client();

from your code:

const client = new Discord.Client();
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.