#Discord.js saving variables

1 messages · Page 1 of 1 (latest)

dusky horizon
#

So I'm a beginner coder and specially with discord.js (used other languages more) but what I have never done is trying to store progress, the closest thing was with LUA in roblox but that was way more simple. How can I store simple variables (like money) so when I reset the bot it doesn't reset the variables?? The tutorials are kinda confusing to me

stark brook
#

youll have to work with a database, or a file (like JSON or txt if even simpler) if it's really simple

#

variables are stored in memory, or RAM, so they are cleared soon after

dusky horizon
#

I don't wanna sound ultra lazy but do you have any suggested doc/guide?

#

If not it's alr, I'll prob try to understand saving in json

stark brook
#

sorry im not familiar with node, someone else might answer your question later

strong surge
# dusky horizon well I do know about those 2 alternatives, the problem is I get confused with ho...

you can use firebase for simple stuff like that, its an easy to use database that has great support for node.

Here is a tutorial: https://www.youtube.com/watch?v=YPsftzOURLw

Git Hub : https://github.com/syed-ashraf123/nodejs-firebase

Please add your own credentials in config file, otherwise it would not work. Thanks

▶ Play video
strong surge
#

Yea, I don't know why its not used that much

#

its probably the easiest database to setup and deploy for small applications

#

Yea

dusky horizon