how to read and write from a to a file when the code is on github and deployed on railway?

i want to use the github repo to store varibles and debug logs for my python3 telegram bot how can i achieve it?
14 Replies
Percy
Percy2y ago
Project ID: N/A
Percy
Percy2y ago
⚠️ experimental feature
Finn
Finn2y ago
Environment variables?they should not be stored in your repo. And the logs are accessible via the website. Using a custom logger you could upload the logs to s3 potentially Or by using the cloudwatch sdk Ig
JustinMauriceM
JustinMauriceMOP2y ago
no i want to store the varibles of settigns states per group in a seperate file to read them when the bot redeploys as i dont want to use a database is that possible?
Finn
Finn2y ago
Yes. You can do that Just don't store secrets in git
JustinMauriceM
JustinMauriceMOP2y ago
its a pair of chat id and on or off per chat id NEW_BOT_DETECTED_STATE = "on" NEW_BOT_DETECTED_STATE_BY_CHAT = {} NEW_BOT_DETECTEDAUTO_BAN_STATE = "on" NEW_BOT_DETECTEDAUTO_BAN_STATE_BY_CHAT = {}
Finn
Finn2y ago
Yes you can dot that via the method you described
JustinMauriceM
JustinMauriceMOP2y ago
so i could define a json file for example put it in the same repo and than access it to read and write is that right?
Finn
Finn2y ago
Write, no. The changes won't persist to your gh repo You could write if you expect your changes not to persist
JustinMauriceM
JustinMauriceMOP2y ago
so i need a external database for it do i understand it right?
Finn
Finn2y ago
That would be a good way to store persistent config that can be mutated by your app yea
JustinMauriceM
JustinMauriceMOP2y ago
thank you for the quick help
Finn
Finn2y ago
No worries Gl
JustinMauriceM
JustinMauriceMOP2y ago
thanks
Want results from more Discord servers?
Add your server