I am a extremely new coder and I cannot seem to figure out the cause of this error. Any help would be appreciated.
C:\Users*\OneDrive\Desktop\DiscordBot\main.js
e[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)e[39m
e[90m at Function.Module._load (internal/modules/cjs/loader.js:841:27)e[39m
e[90m at Module.require (internal/modules/cjs/loader.js:1025:19)e[39m
e[90m at require (internal/modules/cjs/helpers.js:72:18)e[39m
at Object. (C:\Users\smoke\OneDrive\Desktop\DiscordBot\main.js:2:27)
e[90m at Module._compile (internal/modules/cjs/loader.js:1137:30)e[39m
e[90m at Object.Module._extensions…js (internal/modules/cjs/loader.js:1157:10)e[39m
e[90m at Module.load (internal/modules/cjs/loader.js:985:32)e[39m
e[90m at Function.Module._load (internal/modules/cjs/loader.js:878:14)e[39m
e[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)e[39m {
code: e[32m’MODULE_NOT_FOUND’e[39m,
requireStack: [ e[32m’C:\Users\*\OneDrive\Desktop\DiscordBot\main.js’e[39m ]
}
The quotes have to be like "" not “”, so I fixed that (because JSON validators were going crazy over that!)
I also formatted and shortened the JSON file.
Also, I don’t think node v12.18.3 is available on glitch because Glitch’s help article said these were the versions on Glitch (someone correct me if I am wrong)
const command = require(`./commands/${file}`);
// set a new item in the Collection
// with the key as the command name and the value as the exported module
client.commands.set(command.name, command);
And please don’t show this on the internet! This could allow people to log in as your bot and get your Discord account/bot banned!
Please regenerate it using this method by @Medium/Brandon Russel
How to regen your bot token
If your token has been posted somewhere it needs to be regenerated immediately . Go to the Discord developer portal, select your app, select the “Bot” section, and click “Regenerate”. If you keep a leaked token valid then anyone using it could potentially destroy your servers and ruin your bot