Open saatvikn opened 4 years ago
i am using heroku to host the bot.
I have the same issue with Heroku. Each time a Heroku worker is restarted, it wipes everything including the JSON file. With most bots this doesn't cause any issues but any bot with persistent storage will have this problem. The only way to avoid this would be to set up a separate a database to store the JSON file, but I don't have any code to do this currently.
ok thank you tho. if you find any solution then keep me posted 👍
Persistent storage is a bit tricky on cloud servers for Discord bots in general. What server are you using at the moment?
At the moment this bot uses a simple JSON file to store some configuration settings (although not currently enough to resume reposting), which works OK for local servers, but not very well for online ones. For other bots with persistent storage I had to set up a MongoDB database to store data persistently, but it can be a bit messy to set up.
Depending on the server, if there is a way to keep the previous JSON file it might be possible without setting up a database.