Invalid token

I'm trying to setup the .env file but whenever I try to run the bot its saying invalid token. I've reset the token and put the new token in but still the same error. Am I coding it wrong?
No description
No description
No description
42 Replies
d.js toolkit
d.js toolkit8mo 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! - Marked as resolved by OP
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
crap it was. But even when I changed it I'm still getting the TokenInvalid error
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
They are
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
huh?
No description
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
I cant get it to output anything to console.
No description
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
Yes.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
Sure my bad.
opjesse
opjesseOP8mo ago
No description
No description
No description
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
I changed it to test
opjesse
opjesseOP8mo ago
No description
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
yes
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs8mo ago
:guide: Creating Your Bot: Registering slash commands read more :guide: Creating Your Bot: Configuration files - Using environment variables read more
opjesse
opjesseOP8mo ago
I reset my token now I'm getting this error ( I'm changing my token after don't worry).
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
right after I did = require discord.js fixed that red error Just cant get the invalid token
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
I moved it into the client.on function to see if it logs
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
True.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
I put it right before but it's still not logging anything
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
Here is fine right?
No description
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
yea it does not log anything
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
odd because it was running before I tried setting up the .env file with the token everything worked but as soon as I moved the bot token to .env and tried to register it it just stoped working
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
No description
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
Yea I just tried that It works so its the registering the .env var for the bot token that is erroring Which is weird. If you come up with a idea why this is erroring please let me know! But thanks for helping.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
opjesse
opjesseOP8mo ago
OK no problem! Thanks for the help
Want results from more Discord servers?
Add your server