ReferenceError: discord is not defined

Hello, i am new as discord coder and I keep receiving this error please help.
ReferenceError: discord is not defined
at Object. (C:\Users\Kareem El-Hussein\Desktop\DiscordBot\main.js:3:16)
←[90m at Module._compile (internal/modules/cjs/loader.js:1076:30)←[39m
←[90m at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:941:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:782:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m

C:\Users\Kareem El-Hussein\Desktop\DiscordBot>node main.js
C:\Users\Kareem El-Hussein\Desktop\DiscordBot\main.js:3
const client = new discord.client();

Hello! We need your code for this.

(And if you do not already know, you need to require the Discord JS package you are using in your main.js file.)

1 Like

Try putting this in:
const discord = require('discord.js');

1 Like