Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

hey i had another question. whenever i edit the code of the bot and push it again to the online cloud server, it resets and all the reposts stop. so i have to type the reposting commands again. is their a way to fix this? #41

Open
saatvikn opened this issue Aug 7, 2020 · 4 comments

Comments

@saatvikn
Copy link

saatvikn commented Aug 7, 2020

No description provided.

@saatvikn saatvikn changed the title hey i had another question. whenever i edit the code of the bot and push it again to the online cloud server it resets and all the reposts stop. so i have to type the reposting commands again. is their a way to fix this? hey i had another question. whenever i edit the code of the bot and push it again to the online cloud server, it resets and all the reposts stop. so i have to type the reposting commands again. is their a way to fix this? Aug 7, 2020
@MysteryPancake MysteryPancake self-assigned this Aug 7, 2020
@MysteryPancake
Copy link
Owner

MysteryPancake commented Aug 7, 2020

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.

@saatvikn
Copy link
Author

saatvikn commented Aug 7, 2020

i am using heroku to host the bot.

@MysteryPancake
Copy link
Owner

MysteryPancake commented Aug 7, 2020

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.

@saatvikn
Copy link
Author

saatvikn commented Aug 7, 2020

ok thank you tho. if you find any solution then keep me posted 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants