Ask coding questions

← Back to all posts
Saving My Variables?
Speedrace (7)

How do I keep each of my variables the same even when I refresh the bot to edit the code? It keeps resetting

Vandesm14 (2644)

You could also use a file DB

Speedrace (7)

@Vandesm14 What is that and how do I use it?

Vandesm14 (2644)

@Speedrace If you know how to read and write files, you can save a JSON object to a variable, save it to a file, and pull the JSON from the file on program start.
PS: If you are using private data, you can use a .env file instead, since hides .env

Please mark this as answered if I helped your problem 👍

JackFly26 (97)

I would look into using an external database.