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.
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!
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’.