I have no idea how to solve this error. *help*

at Module._compile (internal/modules/cjs/loader.js:1137:30
)
at Object.Module._extensions…js (internal/modules/cjs/loa
der.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)

at Function.Module._load (internal/modules/cjs/loader.js:8

78:14)
at Function.executeUserEntryPoint [as runMain] (internal/m
odules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47

Hi @qwertyuiopcoder, welcome to the forums!
Could you give the full error that you got in the logs as well as the stack trace? Otherwise, we can’t identify what the problem is. It would also be great if you could include a snippet of the code you’re using.

1 Like

Be sure to include your error message in backticks!

1 Like

Welcome to the forums!

The actual error message isn’t included, so it’s really hard to tell what your experiencing here. Could you please include the entire message?

ReferenceError: Client is not defined
at Object. (C:\Users\Admin\Documents\GitHub\YTD-\index.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30
)
at Object.Module._extensions…js (internal/modules/cjs/loa
der.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)

at Function.Module._load (internal/modules/cjs/loader.js:8

78:14)
at Function.executeUserEntryPoint [as runMain] (internal/m
odules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47


ReferenceError: Client is not defined
at Object. (C:\Users\Admin\Documents\GitHub\YTD-\index.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30
)
at Object.Module._extensions…js (internal/modules/cjs/loa
der.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)

at Function.Module._load (internal/modules/cjs/loader.js:8

78:14)
at Function.executeUserEntryPoint [as runMain] (internal/m
odules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47

ReferenceError: Client is not defined
at Object. (C:\Users\Admin\Documents\GitHub\YTD-\index.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30
)
at Object.Module._extensions…js (internal/modules/cjs/loa
der.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)

at Function.Module._load (internal/modules/cjs/loader.js:8

78:14)
at Function.executeUserEntryPoint [as runMain] (internal/m
odules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
this is the one

Ok, you need to declare the client variable.
At the top of you’re code, you should have something like

const Discord = require("discordjs");

and underneath that you need to add

const client = new Discord.Client();

And that’s it!
Also, in future, you don’t need to reply the same thing to lots of different people - just ping them if you need to by typing @ followed by their username.
Happy Glitching!

2 Likes

Thanks bro, it worked

1 Like

If that worked, kindly mark @Pufferfish101007’s post as the solution by clicking on the button near the bottom right side of the post that says ‘Solution’.

oh i didnt know

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