I need help with bot making on Discord.

I really didn’t understand this. Any better way to explain it? I got tothe change enviromental part but couldn’t figure out the rest sadly. 

Hmm. Are you on Windows? In that case, can you post the output of:

  1. Windows key + R
  2. Type  cmd
  3. Type  node -v

It should output a version number. If it doesn’t, we need to reconfigure your path.

If it does output a version number, change your directory to the directory your bot is in. You can do this using the  cd command. The run  node . .

Yes I’m on windows 10. I did the cmd node v and it displays version 12.1.0 

Oh and I don’t know how to change the files path sadly. 

First of all, I just noticed you probably publicly posted your Discord API token up above please make sure to request a new one from Discord.

Okay, so we now have established that your PATH is correcly set, Node is correctly installed and your developed app should work fine.

If you just forget the last part of my message, can you describe where exactly you’re stuck now? Still the same error as your initial post? 

The token was updated. But now everytime I try doing ‘node .’ within Visual Studio Code, the terminal just technically skips it and does nothing. With no response from the bot and still not going online. And I still don’t know what’s wrong with it at this point. 

et a npm ERR

npm ERR! file C:\Users\HP\Desktop\DiscordBot\package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token b in JSON at position 101 while parsing near '...and fun.",
npm ERR! JSON.parse "main": bot.js",
npm ERR! JSON.parse "dependenc...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-05-05T04_05_47_665Z-debug.log

Any suggestions? I also did try the holding shift then right click to open CMD< but it doesn’t work or I’m just blind. 

@demonwolffang wrote:

Hey!! I’m new here. So I tried making a discord bot but its hard for a first timer. Everytime I do 

npm install discord.io winston -save

I always get a npm ERR

npm ERR! file C:\Users\HP\Desktop\DiscordBot\package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token b in JSON at position 101 while parsing near ‘…and fun.",
npm ERR! JSON.parse “main”: bot.js",
npm ERR! JSON.parse "dependenc…’
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-05-05T04_05_47_665Z-debug.log

Any suggestions? I also did try the holding shift then right click to open CMD< but it doesn’t work or I’m just blind. 

 

 

Ok and I said everything was updated using Visual Studio Code and not Notepad++. In Visual Studio Code I’m having no erros, but the bot just doesn’t want to start everytime I do ‘node .’ and just does absolutely nothing but go to a new command. Couldn’t it be a line error or a wrong command I’m doing? 

@demonwolffang what if you try running  node bot.js  (or  node app.js  if your file is called  app.js  instead of  bot.js )? Do you get the inital error back, or does it run? If you do, check this thread out to see if you can get it resolved: https://stackoverflow.com/questions/24920142/package-json-must-be-actual-json-not-just-javascript

@ceckin6 That looks pretty similar! Have you tried some of the solutions in this topic already? You could also check out the link I posted above for @demonwolffang . Finally, it might be helpful to post your  package.json (using a GitHub Gist (https://gist.github.com/) for example).

Its just the issue where  I run 

node .

But it does nothing. 

Where exactly did you pick up the idea to use  node . ? Because I don’t think that is the command you actually want to use. You are more likely to want to start your application. Thus, you need to provide the name of the file your application consists of. In your case that should be  app.jsbot.js , or similar. At least something ending in  .js.

What  node .  does, is just give the current directory you’re in ( . means “current directory” in the shell) to the node interpeter. It’s not something Node can handle.

So just try to run your  bot.js or  app.js file directly using  node bot.js  (or  node app.js ).

Sorry for the late response, was dealing with school and still am. In the video I watched (https://www.youtube.com/watch?v=X_qg0Ut9nU8)

Said to use the ‘node .’ 

Hi @demonwolffang ,

I suspect that the person in the video uses  node .  because his main code file is called  index.js. So you could either:

  • Also name your code file  index.js  instead of bot.js / app.js ;
  • or run it using  node bot.js node app.js

The file was automatically named index.js and still is. I tried running ‘node .’ in CMD and the node.js app, but continue getting the same response 

node .
...

Hi @demonwolffang ,

Would it be possible to push your project to a GitHub repository. I’d love to investigate using my own environment and understand the bigger picture.

What do you mean? 

If you’re comfortable with it, I’d like to receive a copy of your code so I can test out some things on my own computer.

That works way faster than asking you to test something and letting you post it back here.

Sure. I’ll get it set up for you. 

I need to re-make it because for some odd reason my index.js was deleted? 

Is there a way to message you the bots coding?