#discord bot hosting issue
45 messages · Page 1 of 1 (latest)
06 01:59:20 [Bot] [2023/06/03 02:59:20] Unhandled promise rejection: Error [TokenInvalid]: An invalid token was provided.
03.06 01:59:20 [Bot] at Client.login (/node_modules/discord.js/src/client/Client.js:214:52)
03.06 01:59:20 [Bot] at /src/index.js:183:16 {
03.06 01:59:20 [Bot] code: 'TokenInvalid'
03.06 01:59:20 [Bot] }
Where did u put the token
Is it in a environmental variable
Have you made sure you didn't reset the token? Go to the applications page, press reset token, copy it and save it into your file, make sure you don't reset it again otherwise it will not work
obviously
@plush tendon, you just advanced to level 1 !
its the right token
I personally like sending my token to the bot's dms
Therefore I never need to reset it or lose it
Just reset it, it won't hurt anyone, make sure you save it somewhere safe, such as the bot's dms
Are you using .env or a config file?
configure envirnment
Could you try logging in with the token provided straight into the brackets, make sure the token is a string
.env
Try to log in just normally without .env, put the token straight into the brackets, check if that works to make sure your token is valid
If it works then the error is with your .env and we can have a further look into it
Did you do client.login("token")
wdym
Put the token straight into the brackets
Inside a string
Don't use .env for a minute so we can see if the issue is ur token or .env
Inside your main file
its working fine but thats really weird, env worked fine before
only issue with env that I had is on this hosting rn
.env can act differently in a different server enviroment
Pebble has issues with env
oh
ok