Skip to content
Any workaround to using secrets in a json file?
Profile icon
QuackMeansQuack

The bot I'm using requires the token to be in a json file, but I want to use a secret for it. Is there any workaround?

You are viewing a single comment. View All
Answered by SixBeeps [earned 5 cycles]
View Answer
Profile icon
SixBeeps

Go to this line right here
image
And replace the login parameter with process.env.token.

Profile icon
SixBeeps

@QuackMeansQuack
Swap lines 6 and 7 so that Discord is defined first.

Profile icon
QuackMeansQuack

@SixBeeps

image

Profile icon
QuackMeansQuack

@SixBeeps
It now works perfectly, thanks alot. One of my bots was logged into and nuked my server, so this is a great help.

Profile icon
SixBeeps

@QuackMeansQuack
Ohhh yeah definitely don't want that happening. Glad I could help again. Mind marking my comment as the answer?

Profile icon
QuackMeansQuack

@SixBeeps
How do I do that?

Profile icon
SixBeeps

@QuackMeansQuack
Looks like you've figured it out 👍