Question about a bot

everytime i go to turn my bot on it just repeats this C:\Users\andre\Desktop\discordbot> What do i do i have tried node main.js, node . all of it idk what to do anymore
17 Replies
d.js toolkit
d.js toolkit2w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
monbrey
monbrey2w ago
Sounds like it isnt trying to log in
⌁ Ky ⌁
easy try catch should help that
monbrey
monbrey2w ago
:waitWhat: Cant try catch something that isnt there
⌁ Ky ⌁
whats they are stating is that the process is just exiting without doing anything. With not very much context, putting all the code in a try catch with a console log nearly always will find the problem is what i was getting at least temporarily
monbrey
monbrey2w ago
So no, very vague and non-specific advice. If the client.login() line exists at all the process either wont exit, or will error
⌁ Ky ⌁
then maybe its not client.login, its another function, statement or section thats failing just guessing here
monbrey
monbrey2w ago
A discord.js bot process exiting silently almost always indicates that client.login() wasnt called
⌁ Ky ⌁
true
KYMSO
KYMSOOP2w ago
Yeah I have no idea My guess was I put something in wrong This is my first time having the problem Ok I use node.js
KYMSO
KYMSOOP2w ago
No description
KYMSO
KYMSOOP2w ago
Thats the whole code
duck
duck2w ago
real quick you should reset your token aside from that 1. that looks like v12 (or older) code 2. you haven't saved your code so assuming you're using a supported version of discord.js, that code would error after you save if you're unfamiliar with discord.js overall, you could consider starting from the beginning of an updated guide or in general you'll need to update your code (and remember to save)
Galactic
Galactic2w ago
this ^^ also you should be using a new djs version djs v12 is outdated and you probably installed djs using npm i discord.js, which installs the latest stable version, so that means that your code wont work. also, a recommendation is to follow the guide linked by the guy above me, as it shows you how to hide your token to an extent (as long as you dont show your .env or .json files' content)
monbrey
monbrey2w ago
npm i discord.js does install latest stable.... which is 14.19.3, definitely not anything from v12
Amgelo
Amgelo2w ago
I think they meant that, their code is v12, and they installed with npm i discord.js, which installs v14, so it won't work
Galactic
Galactic5d ago
yeah thats waht i meant lol what*

Did you find this page helpful?