Ask coding questions

← Back to all posts
How to make a private folder
Thanatos31005

hello I'm creating a discord bot and I need my json files to be private how can I do that without upgrading

Voters
HardikKumar1
Comments
hotnewtop
19wintersp

You have very basic options for this. The Hacker Plan's private repls are the best solution, but if you are unwilling, there are two main options:

  1. Store the data in your ".env" file
  2. Encrypt the data and store the key in your ".env" file
Thanatos31005

how do i encode it
@19wintersp

Thanatos31005

@19wintersp how do i encode it

19wintersp

@Thanatos31005 It will depend on the programming language you're using. NodeJS has the built-in crypto library, you can use the cryptography library in Python. Both of these have encryption methods.

Thanatos31005

@19wintersp im using python

19wintersp

@Thanatos31005 Look into the cryptography library, and specifically the fernet module. They have code examples in their documentation.

HardikKumar1

Did you get a way out for this? @Thanatos31005

[deleted]

You can try encrypting the file, but I would just use an external editor

RYANTADIPARTHI

that's not possible.

Coder100

you cannot. The only files that are private are .env files.
To learn how to use them: https://docs.repl.it/repls/secret-keys

note: you cannot just rename files to .env and expect it to work!

caaaaaaaaaallum

@Coder100 what would you do if replit does not allow you to use a .env file anymore

caaaaaaaaaallum

nevermind i got it

kris10chiang

@caaaaaaaaaallum wait so how did u do it

kris10chiang

@caaaaaaaaaallum wait so what did u do